replace deprecated php methods