updated the connection to use a port flag