fix the upload method