fixed bug when uploading directly