Handle errors from within the root QML and fix the navigation flow