fix intersection check