Destroyfunctions corrected