Collision check written, but breaks loop function