Fixed compatibility to previous versions of php