move network checking to right place