ADDED an ugly hack for older PHP versions