fix window closing
Merge pull request #31 from Miktor/WindowClose

fix window closing