fix bug initializing counts to zero