changing doc serialization to as dictionary