Added tear-down functionality