AIP download: fix conditional