*672OPINION
Fred and Harriett Boyce and their daughter Martha Boyce *673(collectively referred to as “the Boyces”) sued their former attorney Roger Bergmann and his law firm (collectively referred to as “Bergmann”), alleging six causes of action. Only one of the Boyces’ claims was submitted to the jury, which returned a verdict in favor of Bergmann. Bergmann subsequently moved for an award of $84,840.50 in attorney’s fees pursuant to NRCP 68 (offer of judgment), NRS 18.010(2)(b) (award of fees for defense of groundless claims), and as sanctions under NRCP 11. Bergmann also moved for an award of $9,501.38 in costs. The trial court denied the motion for attorney’s fees and awarded Bergmann costs. We reverse the order denying attorney’s fees and remand for a proper determination of whether Bergmann is entitled to recover the fees. We also reverse the award of certain costs.
FACTS
Bergmann is an attorney. In 1983, Bergmann successfully represented Fred and Harriett Boyce in a dispute concerning the Boyces’ real estate investment. Subsequently, Fred and Harriett Boyce solicited Bergmann’s advice regarding investment strategies for their savings. During the consultation, Bergmann mentioned that Lemons & Associates offered investors a high return by investing in promissory notes secured by first deeds of trust.
Fred and Harriett Boyce invested $113,000 with Lemons & Associates. Harriett Boyce also invested $17,000 on behalf of her daughter Martha Boyce. Lemons & Associates eventually became insolvent, and Steve Lemons was incarcerated.
The Boyces sued Bergmann, alleging six causes of action against him.1 Bergmann moved to dismiss the complaint pursuant to NRCP 12(b)(5) for failure to state a claim upon which relief can be granted. The trial court denied the motion. Prior to trial, Bergmann made an unapportioned joint offer of judgment pursuant to NRCP 68.2 The Boyces did not accept the offer.
After the Boyces presented their case-in-chief, the trial court dismissed three of their claims pursuant to NRCP 41(b).3 Addi*674tionally, the trial court dismissed Martha Boyce’s claim because she did not have standing to sue Bergmann. The trial court also refused to give an instruction regarding attorney malpractice, effectively dismissing that claim. Of the six original claims, only the claim for negligent misrepresentation was submitted to the jury. The jury found that Bergmann was not liable on this theory.
Bergmann moved for an award of attorney’s fees pursuant to NRS 18.010(2)(b), NRCP 11, and NRCP 68. The trial court denied the award of fees pursuant to NRS 18.010(2)(b) and NRCP 11 because the Boyces’ complaint had survived the NRCP 12(b)(5) motion to dismiss and because the court dismissed only a few of the Boyces’ claims pursuant to NRCP 41(b). The trial court held that Bergmann was not entitled to recover attorney’s fees pursuant to NRCP 68 because Bergmann’s unapportioned joint offer of judgment was invalid. However, the trial court did award Bergmann his costs.
DISCUSSION
A. NRS 18.010(2)(b).
A trial court “may make an allowance of attorney’s fees to a prevailing party . . . when the court finds that the claim ... of the opposing party was brought without reasonable ground or to harass the prevailing party.” NRS 18.010(2)(b). The decision whether to award attorney’s fees is within the sound discretion of the trial court. County of Clark v. Blanchard Constr. Co., 98 Nev. 488, 492, 653 P.2d 1217, 1220 (1982); see National Tow v. Integrity Ins. Co., 102 Nev. 189, 191, 717 P.2d 581, 583 (1986). However, where a trial court exercises its discretion in clear disregard of the guiding legal principles, this action may constitute an abuse of discretion. Franklin v. Bartsas Realty, Inc., 95 Nev. 559, 562-63, 598 P.2d 1147, 1149 (1979); Cooter & Gell v. Hartmarx Corp., 496 U.S. 384, 405 (1990) (“A district court would necessarily abuse its discretion if it based its ruling on an erroneous view of the law . . . .”); Gakiya v. Hallmark Properties, Inc., 722 P.2d 460, 463 (Haw. 1986) (disregarding rules or principles of law to substantial detriment of a party litigant constitutes abuse of discretion). In the instant case, the trial court applied an incorrect legal standard in determining whether it should award attorney’s fees under NRS 18.010(2)(b).
A trial court may dismiss a complaint pursuant to NRCP *67512(b)(5) only if it appears to a certainty that a plaintiff can prove no set of facts which would entitle him to relief. Edgar v. Wagner, 101 Nev. 226, 228, 699 P.2d 110, 112 (1985). All allegations pled must be accepted as true. Capital Mortgage Holding v. Hahn, 101 Nev. 314, 315, 705 P.2d 126, 126 (1985). In denying Bergmann’s motion to dismiss on the pleadings, the trial court acknowledged that it engaged in a restricted analysis. The trial court noted that the parties had raised “a legion of factual matters which have not been subjected to even the barest form of discovery.”
The standard applied to a motion to dismiss on the pleadings differs from the standard applied to a post-judgment motion for attorney’s fees. In assessing a motion to dismiss, the trial court assumes that the underlying facts support the allegations of the complaint. In assessing a motion for attorney’s fees under NRS 18.010(2)(b), the trial court must determine whether the plaintiff had reasonable grounds for its claims. Such an analysis depends upon the actual circumstances of the case rather than a hypothetical set of facts favoring plaintiff’s averments. See Western United Realty, Inc. v. Isaacs, 679 P.2d 1063, 1069 (Colo. 1984); Fountain v. Mojo, 687 P.2d 496, 501 (Colo.Ct.App. 1984) (A claim is groundless if “the complaint contains allegations sufficient to survive a motion to dismiss for failure to state a claim, but which are not supported by any credible evidence at trial.”). Thus, the fact that the Boyces’ complaint survived a 12(b)(5) motion to dismiss was irrelevant to the trial court’s inquiry as to whether the claims of the complaint were groundless. The trial court could not base its refusal to award attorney’s fees upon the 12(b)(5) ruling.
The trial court also based its refusal to award fees upon the fact that it dismissed only a few of the Boyces’ claims for failure to present sufficient evidence. In fact, only one of the Boyces’ claims survived the trial. The prosecution of one colorable claim does not excuse the prosecution of five groundless claims. Trus Joist Corp. v. Safeco Ins. Co. of Am., 735 P.2d 125, 140 (Ariz.Ct.App. 1986) (case remanded for trial court to apportion attorney’s fees between grounded and groundless claims); Department of Revenue v. Arthur, 734 P.2d 98, 101 (Ariz. Ct.App. 1986) (“The fact that not all claims are frivolous does not prevent an award of attorneys’ fees.”); Fountain v. Mojo, 687 P.2d at 501 (“[A] prevailing party must be afforded an opportunity to establish a reasonable proration of attorney fees incurred relative to the defense of a frivolous or groundless claim.”). If, on remand, the trial court finds that some of the Boyces’ claims *676were groundless, it should allocate Bergmann’s attorney’s fees between the grounded and groundless claims. The trial court may then exercise its discretion in determining the amount to award Bergmann for defense of the groundless claims. See Hornwood v. Smith’s Food King No. 1, 107 Nev. 80, 87, 807 P.2d 208, 213 (1991).
The record contains ample evidence to support a finding that some of the Boyces’ claims were groundless. Because the trial court’s application of an incorrect legal standard may have substantially affected Bergmann’s rights, we cannot consider the trial court’s error to be harmless. NRCP 61.
B. NRCP 11.
When an attorney violates NRCP 11, the court “shall impose” upon the attorney, the represented party, or both, “an appropriate sanction,” which may include a “reasonable attorney fee.” NRCP 11. As with an award of attorney’s fees under NRS 18.010(2)(b), this court must review the decision of the trial court under an “abuse of discretion” standard. Cooter & Gell, 496 U.S. at 405; see Marshall v. District Court, 108 Nev. 459, 466, 836 P.2d 47, 52 (1992). Bergmann contends that the trial court abused its discretion by basing its ruling on an erroneous view of the law. Cooter & Gell, 496 U.S. at 405. We agree.
The trial court denied Bergmann attorney’s fees under NRCP 11 “[f]or the reasons cited in the discussion of NRS 18.010(2)(b).” NRCP 11 sanctions should be imposed for frivolous actions. Marshall v. District Court, 108 Nev. at 465, 836 P.2d at 52. A frivolous claim is one that is “both baseless and made without a reasonable and competent inquiry.” Townsend v. Holman Consulting Corp., 929 F.2d 1358, 1362 (9th Cir. 1990); see Golden Eagle Distrib. Corp. v. Burroughs Corp., 801 F.2d 1531, 1537 (9th Cir. 1986). Thus, a determination of whether a claim is frivolous involves a two-pronged analysis: (1) the court must determine whether the pleading is “well grounded in fact and is warranted by existing law or a good faith argument for the extension, modification or reversal of existing law” (see Golden Eagle, 801 F.2d at 1537); and (2) whether the attorney made a reasonable and competent inquiry.
The first prong of this test has a component which is similar to the analysis required under NRS 18.010(2)(b): The trial court must examine the actual circumstances surrounding the case to determine whether the suspect claims were brought without reasonable grounds. As we noted previously, the trial court did not base its decision upon such an examination, but instead upon the *677fact that the complaint survived a Rule 12(b)(5) motion to dismiss. The legal standard applied to a Rule 12(b)(5) motion to dismiss differs from the legal standard applied to a Rule 11 motion for sanctions. Westlake North Property Owners v. Thousand Oaks, 915 F.2d 1301, 1306 (9th Cir. 1990). Thus, the trial court abused its discretion by applying an incorrect legal standard to the question of whether Bergmann could recover fees as a sanction under NRCP 11.
We note that the record contains ample evidence from which the trial court could conclude that the Boyces’ attorney failed to make a reasonable and competent inquiry. For example, Fred Boyce testified that he warned his attorney that some of the allegations of the complaint were unfounded. Fred Boyce’s testimony suggests that his attorney may have made some allegations, not as the product of a reasonable and competent inquiry, but in spite of one. In view of the evidence in the record, the trial court’s error may well have affected Bergmann’s substantial rights. Therefore, we cannot say that the trial court’s misapplication of the law resulted in harmless error. NRCP 61.
C. NRCP 68.
A trial court may award attorney’s fees to a party who makes an offer of judgment where the offeree does not accept the offer and “the judgment finally obtained by the offeree is not more favorable than the offer . . . .” NRCP 68. Bergmann made one offer of $4,000 to the three respondents without allocating the offer among them. This court has twice held that unapportioned joint offers of judgment are invalid for the purposes of NRCP 68. Morgan v. Demille, 106 Nev. 671, 799 P.2d 561 (1990); Ramadanis v. Stupak, 104 Nev. 57, 752 P.2d 767 (1988). While acknowledging the general rule of these cases, Bergmann argues that this court should recognize an exception where the defendant is completely exonerated from any liability. We decline to adopt such an exception.
In Morgan, two plaintiffs made an offer of judgment to a single defendant without apportioning the offer between the claims of each plaintiff. Morgan, 106 Nev. at 672, 799 P.2d at 562. Noting that the purpose of NRCP 68 is to encourage settlement of lawsuits before trial, this court held that the offer was invalid: “To consider plaintiffs’ joint settlement offer as valid would deprive defendant of the opportunity to evaluate the likelihood of each party receiving a more favorable verdict at trial.” Id. at 674, 799 P.2d at 563 (quoting Hurlbut v. Sonora Community Hosp., 254 Cal.Rptr. 840 (Cal.Ct.App. 1989)).
NRCP 68 encourages the settlement of lawsuits by raising the stakes for a litigant who receives an offer of judgment. An offeree *678must balance the uncertainty of receiving a more favorable judgment against the risk of receiving a less favorable judgment and being forced to pay the offeror’s costs and attorney’s fees. As this court noted in Morgan, an unapportioned joint offer of judgment deprives the individual offeree of the opportunity to assess the attendant risks. The offeree does not know what he stands to gain by accepting his unspecified portion of the offer, nor can he estimate his chances of receiving a more favorable judgment.
Bergmann contends that his unapportioned joint offer of judgment should be effective for the purposes of NRCP 68 because, regardless of how the offer is allocated among the Boyces, none of them received a “more favorable” judgment at trial. NRCP 68. Though the Alaska Supreme Court has apparently rejected this argument (see Brinkerhoff v. Swearingen Aviation Corp., 663 P.2d 937, 943 (Alaska 1983)), some of California’s intermediate appellate courts have adopted Bergmann’s position. Stallman v. Bell, 286 Cal.Rptr. 755 (Cal.Ct.App. 1991); Winston Square Homeowners v. Centex West, 261 Cal.Rptr. 605 (Cal.Ct.App. 1989); Fortman v. Hemco, Inc., 259 Cal.Rptr. 311 (Cal.Ct.App. 1989).
We believe that adoption of the proposed exception needlessly complicates the already difficult choice which NRCP 68 puts to an offeree. The exception encourages defendants who are hopeful of prevailing absolutely at trial to make unapportioned joint offers of judgment. Individual offerees, unable to determine their share of a joint offer, cannot make a meaningful choice between accepting the offer or continuing the litigation to judgment. On the other hand, adherence to the general rule does not put any greater burden upon offerors.4 Offerors simply must specify the amounts which they offer to each party. We conclude that the better rule is to hold all unapportioned joint offers of judgment invalid regardless of the outcome of the trial on the merits.
D. Costs.
The trial court awarded Bergmann all of his claimed costs. As *679the prevailing party in an action where respondents sought to recover more than $2,500, Bergmann was entitled to recover all of his costs as a matter of right. NRS 18.020(3). The determination of which expenses are allowable as costs is within the sound discretion of the trial court. Mist v. Westin Hotels, Inc., 738 P.2d 85, 92 (Haw. 1987); State v. Meyer, 220 Cal.Rptr. 884, 890 (Cal.Ct.App. 1985); Gilmore v. Rubeck, 708 P.2d 486, 487 (Colo.Ct.App. 1985). However, “this discretion should be sparingly exercised when considering whether or not to allow expenses not specifically allowed by statute and precedent.” Mist, 738 P.2d at 92. The trial court should exercise restraint because “statutes permitting recovery of costs, being in derogation of the common law, must be strictly construed . . . .” Calcagagno v. Personalcare Health Management, 565 N.E.2d 1330, 1336 (Ill.Ct.App. 1991) (citing Commissioners of Lincoln Park v. Schmidt, 69 N.E.2d 869 (Ill. 1946)).
Aside from the trial court’s award of witness fees, respondents dispute the award of expenses which could only constitute costs pursuant to NRS 18.005(16): “Any other reasonable and necessary expense incurred in connection with the action.” In accord with the principals enumerated above, this court must construe NRS 18.005(16) narrowly.
1. Witness Fees.
NRS 18.005(4) defines “costs” to include “[f]ees for witnesses at trial, pretrial hearings and deposing witnesses, unless the court finds that the witness was called at the instance of the prevailing party without reason or necessity.” A prevailing party may also recover as a cost the “[Reasonable fees of not more than five expert witnesses in an amount of not more than $1,500 for each witness . . . .” NRS 18.005(5). The trial court awarded $217.10 in witness fees and $457 in expert witness fees. Much of this sum represents fees paid to witnesses whom Bergmann did not call at trial. The Boyces contend that the expenses for these witnesses were neither reasonable nor necessary because Bergmann prevailed without their testimony. Bergmann counters that the court should not penalize him for making tactical decisions at trial to economize the time of the trial court.
The Eleventh Circuit Court of Appeals has held that a trial court abused its discretion by applying a “blanket rule” that “no costs shall be awarded for expenses incurred in procuring the presence at trial of witnesses who were not called . . . .” Murphy v. City of Flagler Beach, 761 F.2d 622, 631 (11th Cir. 1985). Similarly, the Seventh Circuit Court of Appeals has held that a party may recover the cost of procuring a witness even where the *680witness is not called and is not present in court: “Fees paid to a witness who was subpoenaed but did not actually attend the trial may be allowed as costs ‘when it was reasonably expected that his attendance would be necessary and he had held himself in readiness to attend.’” Spanish Action Comm, of Chicago v. City of Chicago, 811 F.2d 1129, 1138 (7th Cir. 1987) (quoting 6 Moore’s Federal Practice ¶ 54.77[5.-l], at 54-437 (footnote omitted)).
We conclude that calling the witnesses at trial was not a prerequisite to an award of witness fees as costs. On the present record, we cannot say that the trial court abused its discretion in treating these fees as reasonable and necessary. Accordingly, we affirm the award of these fees as a recoverable cost.
2. Westlaw Research Charges.
The trial court awarded Bergmann $110.25 for Westlaw research billed to him by his attorneys. The Boyces contend that a law firm’s charges for computer research are better considered part of the attorney’s fee or non-recoverable overhead rather than an allowable cost. We agree.
Some federal courts have permitted the recovery of expenses for computer research as a cost so as to encourage attorneys to reduce “the number of attorney hours otherwise needed for (presumably) more time-consuming manual research . . . .” Harman v. Lyphomed, Inc., 945 F.2d 969, 976 (7th Cir. 1991); see also United Nuclear Corp. v. Cannon, 564 F.Supp. 581, 591-92 (D.R.I. 1983). The rationale of these cases seems to implicitly recognize that computer research is a substitute for attorney time, but nevertheless treats the computer research as a cost so as to promote a collateral policy goal of reducing overall litigation expenses.
On the other hand, the Eighth Circuit Court of Appeals has held that computer research is not a taxable cost: “We believe that computer-aided research, like any other form of legal research, is a component of attorneys’ fees and cannot be independently taxed as an item of cost . . . .” Leftwich v. Harris-Stowe State College, 702 F.2d 686, 695 (8th Cir. 1983); see also Cutter v. Town of Farmington, 498 A.2d 316, 322 (N.H. 1985).
Attorneys incur computer research expenses as a function of their research of the law. Thus, this expense is more closely related to the attorney’s fee than to the kinds of recoverable costs defined in NRS 18.005. Although reducing overall litigation expenses is a desirable objective, there is no indication that the Nevada Legislature intended NRS 18.005 and NRS 18.020 for that purpose. Construing NRS 18.005(16) narrowly, we hold that computer research expenses are not recoverable costs.
*6813. Document Preparation.
On appeal, Bergmann explained that the trial court’s award of $1,820.91 for document preparation represented the cost of word processing services. As a general rule, federal courts have classified word processing and document preparation by legal secretaries as a “normal out-of-pocket” expense which is “generally not included in the taxable costs.” Dow Chem. Pac. Ltd. v. Rascator Maritime S.A., 640 F.Supp. 882, 886 (S.D.N.Y. 1986); see also Hasbrouck v. Texaco, Inc., 631 F.Supp. 258, 268 (E.D.Wash. 1986), rev’d in part on other grounds, 879 F.2d 632 (9th Cir. 1989) (“The ongoing costs of secretarial employees should ordinarily be paid from the attorneys’ hourly fees.”).
However, courts will award these fees where the secretarial costs were not routine office overhead. See Hasbrouck, 631 F.Supp. at 268 (“[T]he court concludes that the expense of hiring extra document workers for work only on a specific case may be properly allowed” as a cost.). In Hasbrouck, the district court denied the prevailing party’s claim for the cost of document workers because the prevailing party did not carry its burden of demonstrating that the workers were employed exclusively for work on the instant case. Id.
Bergmann argues that his firm’s document production is an extraordinary expense not included in routine office overhead. However, Bergmann has not presented any circumstances indicating that his counsel was required to hire additional workers, or indicating that counsel’s current staff was required to perform extraordinary services.
The fact that Bergmann’s counsel separately billed him for document production does not make this expense a recoverable cost: “While this Court recognizes that a few firms in this district have taken to the practice of ‘breaking out’ such charges for billing purposes, it is a practice which this Court cannot condone.” Bankers Sec. Life Ins. Soc. v. Kane, 692 F.Supp. 1326, 1330-31 (S.D.Fla. 1988). A law firm may not expand the coverage of NRS 18.005 simply by changing its billing practices.
The trial court did not have an adequate basis for awarding the expense of document preparation. Accordingly, we hold that the trial court abused its discretion by awarding this expense as a cost.
4. Messenger Service.
The trial court awarded Bergmann $98.50 for messenger service expenses. The federal courts disagree on the question of *682whether expenses for messenger services are recoverable costs. The Ninth Circuit Court of Appeals has stated that courts routinely award the cost of air courier services pursuant to fee statutes. International Woodworkers of America v. Donovan, 769 F.2d 1388, 1392 (9th Cir. 1985). Other courts have held that parties generally may not recover the cost of messenger services. Dow Chem. Pac. Ltd., 640 F.Supp. at 886 (expenses for couriers a normal out-of-pocket disbursement not generally included in the taxable costs); Hollenbeck v. Falstaff Brewing Corp., 605 F.Supp. 421, 439 (E.D.Mo. 1984), aff’d, 780 F.2d 20 (8th Cir. 1985) (charges for Federal Express and local delivery service a non-taxable out-of-pocket expense). A third approach is to allow the district court to exercise its discretion in determining the extent to which such expenses were necessary and awarding an appropriate amount. See In re Chrysler Motors Corp., 131 F.R.D. 665, 673 (E.D.Mo. 1991) (prevailing party’s reliance on overnight courier became excessive, and therefore court awarded only one-third of amount claimed as a cost).
We conclude that the federal district court’s approach in In re Chrysler Motors Corp. is consistent with NRS 18.005(16). The trial court may award courier expenses to the extent that the court determines that the expenses incurred were reasonable and necessary. On the present record, we have no reason to believe that the trial court abused its discretion in awarding this cost.
5. Other Expenses.
The trial court awarded Bergmann $950 for witness preparation and $1,050 for juror analysis. Bergmann has not attempted to justify these expenses as reasonable and necessary under NRS 18.005(16). Perhaps, at some future time, the practice of law will develop to a point where litigation attorneys necessarily incur such expenses as a matter of course. That time is not yet upon us. We hold that the trial court abused its discretion in awarding Bergmann the costs of witness preparation and juror analysis.
CONCLUSION
The trial court denied Bergmann’s motion for attorney’s fees pursuant to NRS 18.010(2)(b) and NRCP 11 based upon an incorrect legal standard. Application of the incorrect legal standard constituted an abuse of discretion which in this case may have prejudiced Bergmann’s substantial rights. Therefore, we must set aside the trial court’s order denying attorney’s fees and remand for a proper analysis by the trial court.
We affirm the trial court’s ruling that Bergmann was not *683entitled to attorney’s fees pursuant to NRCP 68. For the purposes of NRCP 68, an unapportioned joint olfer of judgment is invalid regardless of the judgment subsequently obtained at trial.
Finally, we affirm the trial court’s award of witness fees and messenger service expenses as costs. However, we reverse the award of computer research, juror analysis and witness preparation expenses because these expenses are not allowable costs under NRS 18.005. We also reverse the award of document preparation expenses because Bergmann has failed to demonstrate that these expenses were anything more than ordinary overhead.
Accordingly, we reverse the order of the district court denying attorney’s fees and remand for further proceedings consistent with this opinion. We reverse the award of costs for computer research, juror analysis, witness preparation and document preparation. In all other respects, the order of the district court is affirmed.
Rose, C. J., Steffen, Springer and Shearing, JJ., Zenoff, Sr. J.5 concur.