1999 dodge ram 2500 5.9 360

Ok guys need some more help I changed the out the cam sensor in the dizzy now the truck is throwing P1391 fault code Intermittent Loss of CMP or CKP.
Loss of the Cam Position Sensor or Crank Position
sensor has occurred.
I'm not sure which direction to go and some help would be appreciated