add reboot function, bugfixes