fix condition-case bug