update for max width and height