switch to ensure so that it still unlocks on an exception
should raise named exception instead of RuntimeException