implemented destroy functionality.