fixed a typo and fixed a bug in cancel