handle edge cases happening during serialization