Added check_socket for reboot function