Fixed nullPointer when preventing multiple locks