switch to ensure so that it still unlocks on an exception