Global structure of the multiverse and the measure problem