add more logging to retrieve doc