fixed type check for port number.