$destroy implemented with tests