Work from previous week and a fix
Free lock even on exceptions