error checking for port and server