Fixed bug on cancel