fix undeclared variable on preview_download