added port selection for client