working download - improved