update code can run php5.2