fixed a bug and refactored out jQuery from app.js