fixed bug when restarting

fixed bug when restarting