fix horrendous bug with collision detection