Made a retry_on_exception world function that will retry the given function