Added else to prevent checking with the server for every route change after initial login