fix locking to optimistic