fix bug in upload