Fixed bug for old PHP versions (PHP < 5.4)