updated php code