LPS-42325 Moves process query to the right place