Fix locking