improved cancel test