implemented auto-repairing of queries which lack recurse statements