fixed anonymous function check