make some changes to support recommend function