fix downloadDir and add test