fix parsing the incoming and normalized query