Fixed undefined add_fields