upload script improved