bad port handling changes