FIX counting bug