retry function

A wrapper around try that retries on failure