allow graceful shutdown of server