Fix Query Bug