Fix bug where adding undefined param to urls without query params