made dialog width more flexible