fixed shutting down process