add initialization of IsActive
fix: change if  in reasoning
fix if