stop application with CTRL-W if no diagram is opened