improved clash check