recursive serialization for Hash