updated: 优化判断逻辑