fixing Repository.upload