Fixed slight bug for PHP5.4