Serialize is used in WriteDir