fix issue with lock, which could cause a crash