bugfix to test restarting script - would not restart in some cases