Try to exit gracefully