Fix federated recipe compile error

This code needed to be in the each block to have access to the result variable.