Creating an Efficient Data Analysis Workflow Part 2, object not found

https://app.dataquest.io/m/516/guided-project%3A-creating-an-efficient-data-analysis-workflow%2C-part-2/3/handling-missing-data

new_sales <- new_sales %>% 
  mutate(
    new_total = if_else(is.na(total_purchased),
                        purchase_mean,
                        total_purchased)
    )

What I expected to happen:
I know that this part of the code should create a new column based on the average total purchased value calculated earlier.

What actually happened:
But I get an error saying that ‘false’ should be a double vector, not an integer vector. Also when I try to check the data type of total_purchased, it says it’s not found. I can’t change it’s data type.

Error: Problem with `mutate()` input `new_total`.
x `false` must be a double vector, not an integer vector.
i Input `new_total` is `if_else(is.na(total_purchased), purchase_mean, total_purchased)`.
Run `rlang::last_error()` to see where the error occurred.
> View(new_sales)
> typeof(purchase_mean)
[1] "double"
> typeof(total_purchased)
Error in typeof(total_purchased) : object 'total_purchased' not found

Hello @jadeve.jimenez provide the link to the mission you are referring to.

I am having the same problem. Is there a solution to this?