Fixed to use document.ready instead of just calling the app initialized.