Use create_function instead of closure to preserve 5.2 compatibility