wrote a method call to destory in index