updated logic of workspace locking