Fixed bug on upload script