added new condition when checking if we are viewing the control panel