made more backwards compatable for older versions of php