changed query string extraction code to select everything after the first '?'