fix validation if string is nil