Added proper window resizing