implement graceful restart