fix port management