modified network logic, fixed problem with last octet not being validated properly