fixed bug in tear down class