a better solution to increment string