fix index for port id