fix some logic bug