fixed count bug