You already have a reference to `legend` so no need to do the lookup again here.