adding port number logic