tweak port handling