fix infinite loop issue with nested models