fixed query string parsing