Locking bugfix