improve collision detection