Fixed bug with Shutdown error