Added character collision detection