panel plugin chnages

fix the bug of panel plugin, and add unit test for it.