fix a bug with custom model generators