Cancel button now handled correctly