[TASK] Use a condition to avoid removal of non-existing variable