fixed the right-angle collision detection bug