modal size issues

fixes issue #2599 and #2540