fixed bug when switching to same panel