teardown session on error