Fixed a bug in hide and show panel