Add teardown method

Add teardown method, as the ON_SHUTDOWN method does not get called
before the class is destroyed