logic fix, controller.js