check port is valid