ensure main IOs are pickleable