fixed some errors in controllers.js