Changed helper cancelling to a function