Correcting a bug to get the first docinfo elements instead of the last one each time