Added graceful shutdown methods