Implemented checking network state, resolved #4