Added an extra check to avoid extra dots in names.