Fixed window resizing issue