mainWindow.js: reimplement delete