This should be wrapped in a try catch lock