switching between windows in app.js