Corrected query string fix

#189 redo

(Not sure if this should be a new PR but since the previous one was already merged I thought this would be the best way)