fixes anonymous function compatibility issue