improved locking