Fixed data creation to wait for required documents by using the Q library