more graceful shutdown of service