Fixed # problem at the end of url when buttons clicked