implement block scope locking