Generate URL function now correctly adding options to the query string