added missing scope.$apply