updated so that it can work with links outside of nav