clicking on a NavLink element changes url but have to click the link twice for the changes to take effect