Added retry with error handling