change code according to review