moved $scope.hist_insert to var hist_insert