fixed bug in uploadFile