reboot logic