catch exceptions before defer {} does