improve locking scope