added calls to check if the network is public

 (used to only check ifnetwork was on your project)
@gsilvis did not want the statement longer than ~80 characters, with the and it was over 100. That is why I nested