support for serializing nested dictionaries