change the old code to the lastest version