Fixed bug on restart