fixed counting bug...