bug fix in upload