Making port choice dynamic