checking for port = -1