Update controllers.js

Changed global variables to use rootScope