Fixed technical debt in controlpanel.js