fix directory serialization