Added port number validation