fix port reading