fix window resizing event