fix bug in counting the epoch digits