bugfix for query string substitution