updated query string handling