Changed document.ready to app.ready