Retry 3 times before raising an error (fixes #42)