fixed bug in < PHP 5.2.3