Fixed double pointer deleting