fixed error with nested dictionaries