Fixed bug in cancel bug