added checkConnection to .run in app.js