fix doc retrieval