add %destructor and function call