implemented test canceling functionality