reset context on error