improved name select logic
improved name select logic