used destory instead of end