change how to retrieve port