Add cancel function.