anonymouse function replaced by create_function to improve compability.