Fixing behavior on cancel and confirm buttons.