add debug for save errors