using checkIfCancelled closure