adjust max width and max height of dialog box