fixed index out of bounds error on name prettify