fixed issue with calling modelDef.render too many times