Add reboot code to each function