locking detection