Removed bug in model_factory.js