fix port extraction