add popular logic
fix some errors