previousRoute undefined check