Added retry logic.

Fixes #40 
Should you return here?