Added destroy function that was previously missing