adds state field to errors