Update model.js

fixes #12