Set value when val is not nil.

Before fixing it, we cannot set false with this condition