fix error for inserts