collision detection and effect for collision