Fixed bug in model.js