Refactor: change unwind-protect to condition-case