Only add query string if required