negative count bug fixed