fix for dialog box not appearing in the center.