Added support for tear down functions