dynamically get port and name