Try to shut down gracefully