Fixed crash on restart