added fix for error processing