Homoclinic orbits of invertible maps