fixed typo and reduced a dupe line of code