rework valid_ip? method