fixing anonymous function (PHP < 5.3)