implemented deconstructor