fix download to skip directory paths