fixed restarting bug