fixed query parser to return parsed/pruned string
a