added graceful shutdown
added graceful shutdown