added reboot logic