add basic error processing