Fixed code in order to work with PHP 5.3