add  graceful shutdown