modified getCurrentRoute method.