fix some logical bug