fixed bug in mobile_template destructor