Fix #198 - Reordered functions to show error alert dialog.
Merge pull request #199 from vreixo/issue198

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