upgrade code to 4