Fixed bug where I did not release the locks in some cases