change error to struct error