Fix #198 - Reordered functions to show error alert dialog.

Fix #198 - Reordered functions to show error alert dialog.