updating query and doc