implement getDocument