fix output when type is StringIO