fix destroy method causing crash