make upload script compatible with modal