adding destroy method using js rendering