fix osx-window bug