handle IO serialization