Added retry code to data retrieval