fix to work wih recent versions of PHP