Added typeof control in my name function to detect if the current  value isn't a string.