fix issue when value is null or undefined