move NETWORK MODE to global var