protecting the sorting functionality from potential field injection