Modify plugin to close app on last window exit