Added port handling