bug fix for nested models