Implemented Shutdown on console closing