Added ability to replace URL when using navigateToElement