Added a networkReceiver to change the working state when the network
state changes