added query decoder