making saved query JS code compatible with turbo links