added code so that if the main page doesn't work, a mirror is tried