modify code according to reviewer’s comment