                                         link:URL.init(string: path)!,
                                         time:time,
                                         rank:(playitemArrayController.arrangedObjects as AnyObject).count + 1)
-                    playitemArrayController.insert(item, atArrangedObjectIndex: row + newIndexOffset)
+                    if (row+newIndexOffset) < (playitemArrayController.arrangedObjects as AnyObject).count {
+                        playitemArrayController.insert(item, atArrangedObjectIndex: row + newIndexOffset)
+                    }
+                    else
+                    {
+                        playitemArrayController.addObject(item)
+                    }
                     newIndexOffset += 1
                 } else {
                     print("accept item -> \((itemURL as AnyObject).absoluteString)")

            super.keyDown(with: event)
        }
    }
    
    func tableViewColumnDidResize(notification: NSNotification ) {
        // Pay attention to column resizes and aggressively force the tableview's
        // cornerview to redraw.
        self.cornerView?.needsDisplay = true
    }


     }

    // MARK:- Drag-n-Drop
/*
    func draggingEntered(_ sender: NSDraggingInfo!) -> NSDragOperation {
        let pasteboard = sender.draggingPasteboard()

