staterror func do no generate records in history table