added a check for the path argument in the PersistableRoute::replacePatterns method