better graceful shutdown in cluster mode