trim query string