add optimistic locking