found and fixed error in upload code