fixing this so it doesn't create an invalid URL and have a console error