retry function.