upload() method fix