cleaning / setting up destroy function