07 outlander 500 cut out issue

I have a outlander 500 and Iam having an issue with it cutting out. It will run perfect then it acts like you shut the key off for a second and turned it right back on. It may do this 3 or 4 times if I ride it all day. I checked the fuel pressure and it was good it had 51 psi I put a new fuel filter on it. But I have noticed it started doing this after the speedometer started acting up. The speedometer will read zero when riding it then all of a sudden it will start going crazy and every time it cuts out the speedometer needle jumps up to like 60 mph. Every time I ride it I know exactly when it’s going to cut out because the speedometer needle will go crazy. The speedometer needle will also go crazy when it’s not moving it will do it when it isn’t moving as well the fourwheeler will just die but it always start right back up. It does it whether the machine is warmed up or it is cold. I don’t want to start throwing parts at it just yet any ideas?