Collision detection added