fixed onResize context error and app var in app.js