add destroy method to element