add destory function to app