if (currentIndex !== $scope.layout.length - 1) {
            // remove item from the list
            $scope.layout.splice(currentIndex, 1);
            // reinsert at desired index
            $scope.layout.splice(nextIndex, 0, widget);