remove anonymous function for old php versions