Fixed a bug that was causing a redirect to the main page when loading the app from a different route than the main route.