fix encoder bug and new method
support empty queries
0.20