handle reboot properly