addaptation to latest code