fixed counting bug again