decode query