Correct the nested item selection logic