Bug fix in panel.js