fixed window resizing bug