fix off-by-one error in initializing $scope.frames