fix types in download function
add test download