fixed a logic error in the locking plugin