improve vertical collision detection