fix fileCounter bug