Change retry to wrap function.