how to mate chain to sprocket when i move my sproket the chain messup pls help me .thx

how to mate chain to sprocket when i move my  sproket the chain messup pls help me i use path to draw a single line to make chain follow the path but when i use mouse rotate sproket chain messup  run out of lacation pls help.. thxx

SolidworksSimulation