fixed query parsing issue