correct a bug preventing data deletion when switching data type