fix bugs in conditions and add break; and continue;