add rate function and DB data