fix count vs weight bug