added methods to stop gracefully