Fixed bug in Upload method