Raise TypeError added when a list is not passed