Clearing it out is fine.  I think that's good to avoid confusion.

All you need to do is put some sort of query parameter function in utils, and call it from  here, and i'll merge this.