use destroy instead of end