add @classmethod decorator to from_dict