collisions detection fixed