Update model.js

fix for empty result sets