fix bug on cancel click