improved upload script, fixed case where uploads with no duration were broken