controller now works on scope instead of rootScope