fix an index out of bound crash
comment to explain why the dual_pane_mode tag is used