application now shows a window when an exception is thrown and the order of validating and setting of visibility for main window when creating is changed