moved these lines below - reorg needed to access the `this` context of the caller in the `oncancel` callback