This check should still be before the display of the modal dialog box