fix some bugs in panel