Modify check for port validation