fixes #6
made startstop script more robust.