added intersection check method