add a isLock method to check if a lock exists