how to add a sub-attributes in a dictionary