Added ensureIndex to app.js