Fixed crashing on restart