put the netsync checking as the first if.