implemented ui router and authentication on route change