fix query in document#check