fixed windowDimensions bug