bug fix to make the code PHP 5.3 compatible