checking if port is not none