add validation for ip and port.