Fixed: query name was hardcoded
Fixed missing encodeURIComponent