added $scope support