switch to use teardown function