More info...
A little more info would help.
When you say it shuts down on you, do you hear any beeps right after the engine dies? Does it spit and sputter before dieing? Have you looked at the plugs to see if your running lean? What color are your fuel lines?
A few answers will go a long way. You will need to eleminate whether it's electrical or mechanical.
Your model 587cc is not equipped with the DESS system, so that can be eleminated. But, your safety switch can be faulty if it is the original.
Look those couple things over and repost..........:cheers: