updated destroy routine