check_overflow: separate the two types of states