sorry I forgot we have no outer scope. Just create a real function at the start of the generate function