bug fix osx-window, not complete