fix #34
Changed logic for resizing first modal window.