
136 Cal.App.3d 841 (1982)
186 Cal. Rptr. 469
THE PEOPLE, Plaintiff and Respondent,
v.
ANDREW CROWDER, Defendant and Appellant.
Docket No. 22700.
Court of Appeals of California, First District, Division Four.
October 22, 1982.
*843 COUNSEL
Quin Denvir, State Public Defender, under appointment by the Court of Appeal, and David R. Lipson, Deputy State Public Defender, for Defendant and Appellant.
George Deukmejian, Attorney General, Robert H. Philibosian, Chief Assistant Attorney General, William D. Stein, Assistant Attorney General, Eugene W. Kaster and W. Eric Collins, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
POCHE, J.
Andrew Gordon Crowder appeals from the entry of a judgment of conviction after a jury found him guilty of forgery of a prescription (Bus. & Prof. Code, § 4390) and possession of codeine (Health & Saf. Code, § 11377, subd. (a)). Before trial he admitted that he had served a prison term within the meaning of Penal Code section 667.5, subdivision (b).[1] We affirm.


*844 Facts

On November 15, 1980, John Morrison, a pharmacist at Scully Drug Company located in Petrini Plaza in San Francisco, received a telephone call from a man who identified himself as Dr. Lichtenstein. The caller ordered a prescription of 60 tablets of empirin and codeine number 4 for Alex Bailey and supplied the prescription directions, the doctor's telephone number, California license number, and Federal Drug Enforcement Administration narcotics registry number. Morrison became suspicious of the caller, who had a southern accent, because he knew that Dr. Lichtenstein had a German or European accent.
Soon after the telephone conversation, Morrison filled the prescription. He then telephoned Dr. Lichtenstein who confirmed that he had not ordered a prescription for Alex Bailey. Morrison then sent a clerk to alert Alonzo Reece, Petrini Plaza's private security guard.
About 15 minutes after the telephone call, appellant entered the pharmacy, identified himself as Alex Bailey, and asked for a prescription from Dr. Lichtenstein. Morrison sold the prescription to appellant. Reece then arrested appellant and removed the prescription from his pocket.

Discussion
The superior court erred in denying the motion to suppress the codeine pills seized by Reece.
(1a) Appellant moved to suppress (§ 1538.5) the pills seized by Reece on the ground that the search of his pocket was illegal under the principles of People v. Zelinski (1979) 24 Cal.3d 357 [155 Cal. Rptr. 575, 594 P.2d 1000]. The trial court denied the motion to suppress. This was error.
When appellant was arrested, Reece was not acting as a police officer, but as a private security guard. "Store detectives and security guards are retained primarily to protect their employer's interest in property. They have no more powers to enforce the law than other private persons. [Citations.] Like all private persons, security employees can arrest or detain an offender (Pen. Code, § 837) and search for weapons (Pen. Code, § 846) before taking the offender to a magistrate or delivering him to a peace officer (Pen. Code, §§ 847, 849)." (People v. Zelinski, supra, 24 Cal.3d at p. 362; fn. omitted.) (2) Absent statutory authorization, private citizens are not permitted to take property from other private citizens. (People v. Sandoval (1966) 65 Cal.2d 303, 311, fn. 5. [54 *845 Cal. Rptr. 123, 419 P.2d 187], cert. den., 386 U.S. 948 [17 L.Ed.2d 878, 87 S.Ct. 985]; People v. Zelinski, supra, 24 Cal.3d at p. 363.)
(1b) On appeal, the People do not seek to justify the seizure of the pills as incident to a weapons search. Instead, they characterize Reece's action as being within a merchant's authority to search as codified in section 490.5, subdivision (e). Paragraph (3) of that subdivision provides in part: "During the period of detention any items which a merchant ... has probable cause to believe are unlawfully taken from the premises of the merchant ... and which are in plain view may be examined by the merchant ... for the purposes of ascertaining the ownership thereof." (Italics added.)
There simply is no evidence to support a finding, express or implied, that the pills were in plain view. The facts before the judge at the section 1538.5 hearing were: Morrison handed appellant the pills, appellant put the pills in his pocket, and Reece searched the pocket and retrieved the pills. Because Reece exceeded his statutory authority when he entered appellant's pocket, the trial court erred in denying the motion to suppress the pills. (People v. Zelinski, supra, 24 Cal.3d at pp. 366-367.)
Nevertheless, the erroneous admission of the pills at trial does not warrant reversal. Morrison, Reece, and appellant testified at trial that appellant took possession of the pills at the pharmacy. Thus, the physical evidence  the pills  was merely cumulative of appellant's own admission that he possessed them. Appellant's defense was that he did not know that the pills contained codeine. The strength of that defense was not affected by the erroneous admission of the pills. (3), (4) (See fn. 2.) (1c) Therefore, it cannot be said that a result more favorable to appellant would have been reached in the absence of the error. (People v. Watson (1956) 46 Cal.2d 818, 836 [299 P.2d 243]; Cal. Const., art. VI, § 13.)[2]
The trial court did not err in denying appellant's motion to dismiss the charge of unlawful possession of codeine.
Appellant was charged with two counts: forgery of a prescription and possession of codeine. At the first preliminary hearing, held December 2, *846 1980, the People did not call Alonzo Reece to testify. The magistrate dismissed the proceeding against appellant pursuant to section 871[3] stating: "From the testimony given thus far, it appears that the officer who is before the Court did not, in fact, do the search in this regard, and therefore the motion to suppress would lie. With the posture of the case at this time, counsel, I would suggest that the People regroup and proceed...."
Thereafter, the People filed a new complaint recharging appellant with the identical charges. At the conclusion of the preliminary hearing on the second complaint held December 15, 1980, the magistrate held appellant to answer on the forgery of a prescription charge, but dismissed the charge of possession of codeine.
Fourteen days later, on December 29, 1980, the People filed an information pursuant to section 739, charging appellant with forgery of a prescription and with possession of codeine. Appellant later moved in the superior court to strike the possession of codeine charge on the ground that it had been twice dismissed. The motion was denied without comment by the superior court.
(5a) Appellant contends that further prosecution of the charge of possession of codeine was barred by section 1387, as amended in 1980, because that count had twice been dismissed. The People counter that section 1387 is not a bar to prosecution, and that even if it is, the 1980 amendment is inapplicable because it did not become effective until January 1, 1981. We conclude that section 1387 is a bar to prosecution of a count which has been twice dismissed by a magistrate, but hold that the statute does not apply where both dismissals occurred prior to its effective date.
Following the Supreme Court's decision in People v. Peters (1978) 21 Cal.3d 749, 750-753 [147 Cal. Rptr. 646, 581 P.2d 651][4], which held that then section 1385 authorized dismissals by trial courts but not magistrates, the Legislature in 1980 enacted a comprehensive revision of the numerous statutory provisions delineating a magistrate's power to *847 dismiss. (Stats. 1980, ch. 938, §§ 1-9; Coleman v. Superior Court (1981) 116 Cal. App.3d 431, 435-436 [172 Cal. Rptr. 135]; People v. Salzman (1982) 131 Cal. App.3d 676, 682-683, fn. 2 [182 Cal. Rptr. 748].)
The most relevant 1980 revision to our inquiry is to section 1387, which provides that "[a]n order terminating an action pursuant to ... Section ... 871 ... is a bar to any other prosecution for the same offense if it is a felony ... and the action has been previously terminated pursuant to ... Section ... 871, ..."[5]
(6) The People seek to avoid the application of section 1387 by contending that a magistrate's dismissal of only a portion of a criminal complaint is not "an order terminating an action" within the meaning of that section. They contend that it cannot be such as it is permissible to file the dismissed count in the information pursuant to section 739.[6]
In Ramos v. Superior Court (1982) 32 Cal.3d 26, 34 [184 Cal. Rptr. 622, 648 P.2d 589], the California Supreme Court rejected the identical contention with respect to a special circumstance which had twice been dismissed pursuant to section 871: "In light of the direct reference to section 871 in section 1387, we also conclude that a dismissal of a special circumstance allegation under section 871 is `an order terminating an action' under section 1387." The court further rejected the notion that section 1387's bar is inapplicable where the twice dismissed special circumstance is refiled by way of the section 739 procedure: "there is nothing in the new legislation to support the People's suggestion that when a charge has already been dismissed twice under section 871, an *848 information filed under the section 739 procedure recharging the dismissed matter is not `any other prosecution for the same offense.' Such a conclusion would significantly undermine both the respect which the new legislation generally accords to dismissals by a magistrate and the added protection from repeated refilings afforded defendants by the amendment of section 1387." (Ramos v. Superior Court, supra, 32 Cal.3d at p. 35.)
(5b) Thus, it is clear beyond peradventure, that section 1387, as amended in 1980, bars further prosecution on a count which had twice been dismissed by a magistrate pursuant to section 871. Nevertheless, that bar offers no comfort to this appellant, for both dismissals occurred prior to the effective date of the 1980 amendment: January 1, 1981.
(7) On December 15, 1980, when the magistrate dismissed the possession count for the second time pursuant to section 871, section 1387 provided: "An order for the dismissal of an action pursuant to this chapter is a bar to any other prosecution for the same offense if it is a felony and the action has been previously dismissed pursuant to this chapter, or if it is a misdemeanor; except in those felony cases where subsequent to the dismissal of the felony the court finds that substantial new evidence has been discovered by the prosecution which would not have been known through the exercise of due diligence at or prior to the time of dismissal." (Italics added.) Dismissals to which this section referred were those described in chapter 8 of the Penal Code, which at that time included sections 1381-1388, but not section 871.
Notwithstanding the fact that the amendment was not yet effective when the second dismissal took place, appellant contends that section 1387 barred further prosecution. The same contention was flatly rejected in People v. Nevarez (1982) 130 Cal. App.3d 388, 395-397 [181 Cal. Rptr. 691]. There, the second dismissal was by way of section 995 rather than section 871, which is a distinction without a difference for purposes of this issue. In rejecting the argument that the action was barred by section 1387, the court commented: "The construction of the amendment of Penal Code section 1387 urged by defendants and accepted by the trial court defeats fundamental notions of fairness and disregards entirely the reliance of the bench and bar upon the former procedural rules. At the time the superior court granted defendant's motions for dismissal under Penal Code section 995 it made it abundantly clear that it was relying upon the People's right to refile those charges. The People, also in reliance upon that right, forewent an appeal and refiled the charges.... Defendants now seek a windfall dismissal by the application of an effect of a dismissal under section 995 which that dismissal did not have at the time it was granted." (130 Cal. App.3d at pp. 396-397.)
*849 Similarly, when the magistrate dismissed the possession charge pursuant to section 871 for the second time, that dismissal did not bar further prosecution. By amendment thereafter, the Legislature changed the effect and nature of the section 871 dismissal. That change does not apply to dismissals which occurred prior to the effective date of the amendment.
In support of his contention appellant cites Horner v. Superior Court (1976) 64 Cal. App.3d 638 [134 Cal. Rptr. 607]. (Disapproved on another point in People v. Peters, supra, 21 Cal.3d at p. 753, and reapproved in Landrum v. Superior Court, supra, 30 Cal.3d at pp. 13-15.) In Horner, the court addressed a 1975 amendment to section 1387 which provided that a second dismissal under section 1385 was a bar to further prosecution. The People had obtained one dismissal prior to the effective date and one dismissal after the effective date of the amendment. The court rejected the People's suggestion that the amendment did not apply: "Section 1387, as amended, was in effect on February 17, 1976, at the time the second dismissal order was made. The prosecuting attorney must have known at that time that he could no longer rely upon the old rule and that a second dismissal would trigger the bar of section 1387 so as to preclude him from refiling and pursuing a charge which already had been twice dismissed pursuant to section 1385. We cannot accept the People's argument that the first dismissal should not count because it occurred before the statute was amended." (64 Cal. App.3d at p. 643.)
Of pivotal importance in Horner was the fact that the second dismissal came after the effective date of the amendment to section 1387, at a time when the prosecution must have known that a dismissal would bar further prosecution. Here, the second dismissal occurred at a time when section 1387 did not limit or bar further prosecution. For that reason Horner is inapplicable.
In sum, the trial court did not err in denying appellant's motion to dismiss the charge of possession of codeine.
The judgment is affirmed.
Rattigan, Acting P.J., and Christian, J., concurred.
A petition for rehearing was denied November 17, 1982. Christian, J., was of the opinion that the petition should be granted.
NOTES
[1]  Unless otherwise indicated, all further statutory references are to the Penal Code.
[2]  When state law alone has been violated a state is free to apply its own harmless error rule. (Cooper v. California (1967) 386 U.S. 58, 62 [17 L.Ed.2d 730, 734, 87 S.Ct. 788].) Our state Constitution, article VI, section 13, as interpreted by the California Supreme Court defines the test as follows: "That a `miscarriage of justice' should be declared only when the court, `after an examination of the entire cause, including the evidence,' is of the `opinion' that it is reasonably probable that a result more favorable to the appealing party would have been reached in the absence of the error." (People v. Watson, supra, 46 Cal.2d at p. 836.)
[3]  Section 871 provides: "If, after hearing the proofs, it appears either that no public offense has been committed or that there is not sufficient cause to believe the defendant guilty of a public offense, the magistrate shall order the complaint dismissed and the defendant to be discharged, by an indorsement on the depositions and statement, signed by the magistrate, to the following effect: `There being no sufficient cause to believe the within named A.B. guilty of the offense within mentioned, I order that the complaint be dismissed and that he or she shall be discharged."
[4]  Peters was overruled in Landrum v. Superior Court (1981) 30 Cal.3d 1, 7-14 [177 Cal. Rptr. 325, 634 P.2d 352].
[5]  As amended in 1980, section 1387 read in full: "An order terminating an action pursuant to this chapter, or Section 859b, 861, 871, or 995, is a bar to any other prosecution for the same offense if it is a felony or it is a misdemeanor charged together with a felony and the action has been previously terminated pursuant to this chapter, or Section 859b, 861, 871, or 995, or if it is a misdemeanor not charged together with a felony, except in those felony cases, or those cases where a misdemeanor is charged with a felony, where subsequent to the dismissal of the felony or misdemeanor the judge or magistrate finds that substantial new evidence has been discovered by the prosecution which would not have been known through the exercise of due diligence at or prior to the time of termination of the action." (Stats. 1980, ch. 938, § 8.)

In 1981, the Legislature added two additional exceptions to section 1387, none of which has any relevance to this case. (Stats. 1981, ch. 854, § 4, p. 3279.)
[6]  Section 739 provides in relevant part: "when a defendant has been examined and committed, as provided in Section 872, it shall be the duty of the district attorney ... to file in the superior court ... an information against the defendant which may charge the defendant with either the offense or offenses named in the order of commitment of any offense or offenses shown by the evidence taken before the magistrate to have been committed...."
