collision detection bug fix