add history and name.length logic