Update index.js

fixing to test for issue where db.models is undefined
merge develop