Fix: checking for modified items on closing