handle locking correctly in workspace