fix bug to only download exactly once