process error and errors as indexed html elements