Added retry logic
Merge pull request #2 from aolei/retry_logic

Added retry logic