updated scanner for query string.