insert and updates merge