fixed bug for PHP<5.5