"nested function as param" problem fixed