fix word counting bug