corrected the lock detector