fixed numbers being appended when indexes have less than 4 digits
fixed formatting for history indexes exceeding 99999