implement retry on error