Moved reboot function call to correct location