save errors and insert