Added additional port validation check