added restriction for window resizing