fixed a bug in the auto increment code