fix line intersection func