fixes #27, check on file changes when closing the window or application