restructured the main to load the router again, and removed router from the app object.