added a tear down function in the semantic analyzer