Fix the case when the previous value is undefined