modify code for 3.0