I have a feeling lock_mode would work better as a function decorator.