collision detection added