fixing addressHistory() logic to deal with inputs