moved sync to app.js; fixed display of logged-in username