Fix query escape