Require destinations when they are needed and do not fetch all of them in advance

Fixes #5266.
add counter and terminate the function if it's more than e.g. `MAX_NAMES_LEVELS=10`