fixed double increment problem