Added validation for Port logic