Fix crash on cancel while drawing