Fixed restarting logic