replace query parameter function with one that isn't complete shit