Fix for encode parameters in query