added working upload and download function