modifing error table and write to database continued