updated funtion to list available ports