Adding support for window resizing.