fix locking to automatic optimistic locking