add a JS handler to avoid unneeded query strings