modified upload failure handling