fix restarting not working properly