add a destroy function