modified upload script