replacing php5.3 obsolete function