bug fixed queryDoc == nil