add index on errors when needed