Added exception handling by awaiting the upload task.