Added retry handling after failure.