Created error messages within the getModuleData function that will be thrown if the documents which are search for are undefined