fix intersection logic