fix error in parsing query string