Update code to fix single-panel issue