improve backward capability with php5.2