fixed self-increment issue