improve patch according to reviewer's suggestion