add support for optimistic lock