Minor fix: now if upload fails, remove will not happen