fixed panel count bug