fix errors running php5