Added retry logic.
Made PR changes.
Merge pull request #41 from arb/retry

Added retry logic.