fixed parsing of port number