show error message when branch code appears in loop