
518 A.2d 624 (1986)
Paul A. CALENDA
v.
ALLSTATE INSURANCE CO.
No. 84-384-Appeal.
Supreme Court of Rhode Island.
December 12, 1986.
*625 Bernard P. Healy, Healy & Jones, Providence, for plaintiff.
Earl E. Metcalf, Paul A. Anderson, Anderson Anderson & Zangari, Providence, for defendant.

OPINION
SHEA, Justice.
This case is before the court on the plaintiff's appeal from the granting of the defendant's motion for a directed verdict. The plaintiff, Paul A. Calenda, brought suit against the Allstate Insurance Company alleging a wrongful failure to defend and indemnify him in a lawsuit that arose out of an automobile collision. The trial justice found that the plaintiff was not the real party in interest and went on to find that the plaintiff failed to present evidence upon which a jury could hold Allstate liable. We remand for a new trial.
The record reveals that on November 28, 1972, plaintiff was involved in an automobile accident in which a gentleman named Hziah Chia suffered serious injuries. Two days later, plaintiff contacted Allstate, through its agent Milton Abrams, to notify it of his claim. Abrams informed plaintiff that his insurance policy had been canceled on October 25, 1972, for nonpayment of premiums. Allstate argued, therefore, that it had no obligation to defend him or to indemnify him against any claims that may arise from the collision.
In November 1975 Hziah Chia filed suit against plaintiff in Superior Court, Providence County. The trial began in June 1980. Before its conclusion, the parties agreed to enter a judgment against plaintiff in the amount of $60,000 on behalf of Hziah Chia. The settlement provided that plaintiff would pay Hziah Chia $2,000 and assign to Chia plaintiff's claim against Allstate Insurance Company. In addition to paying Chia the $2,000, plaintiff commenced this action against Allstate.
The uncontradicted evidence shows that in April 1972 plaintiff purchased an automobile insurance policy from Allstate through Milton Abrams. At the time of purchase, plaintiff made a partial premium *626 payment but made no further payment until November. On October 25, 1972, the policy was canceled for nonpayment of premiums. It is at this point the testimony differs.
On or about October 11, 1972, Allstate sent plaintiff a notice stating that his policy would be canceled for nonpayment of premiums as of October 25, 1972. The plaintiff testified that on or about October 20, 1972, he called Milton Abrams to tell him that he was planning to send a premium payment to Allstate. The plaintiff did not recall, however, whether he received any notice of cancellation prior to his call to Abrams, although he was aware that he was late with his payments. According to plaintiff, Mr. Abrams assured him that he need not worry, that there was a grace period within which plaintiff could make his payment. Allegations about the length of the grace period varied from fourteen to thirty to thirty-one days. The plaintiff testified that he sent a check in the amount of $100 to Allstate's regional office in Farmington, Connecticut, on or before November 24, 1972, four days prior to the automobile accident.
Milton Abrams denied receiving a call from plaintiff in October and testified that he never spoke to plaintiff about a grace period and never told plaintiff not to worry about his insurance coverage. Abrams testified that, in fact, although he had authority to bind Allstate on an insurance policy from the date of application, he had no right to receive payments from or to reinstate a policy holder after Allstate had canceled the policy. There was also testimony that Abrams had authority to receive premium payments prior to the date of cancellation from policy holders who had received cancellation notices. According to Abrams, his first contact with plaintiff, after selling him the policy in April, was on November 30, 1972. At that time plaintiff told Abrams he had been in an accident, and Abrams informed plaintiff that his policy was canceled effective October 25, 1972.
Michael Martynik, casualty claims supervisor for Allstate, and a Bill Trainor, an insurance adjustor, investigated plaintiff's claim with Allstate. Martynik testified that Allstate received and cashed plaintiff's $100 check. According to Allstate's records, the premium was returned to plaintiff on December 15, 1972, and plaintiff acknowledged receipt.
According to Allstate's file on plaintiff's claim, Martynik wrote a note to Trainor on December 21, 1972, that stated, "[L]et's wait for Milt Abrams to act here. If he backs up the cancellation, we are in good hands." On January 8, 1973, Martynik added another notation to the file, stating, "I believe we have enough `ammo' for no coverage situation here." Three days later, on January 11, 1973, Martynik sent a letter to plaintiff informing him that his automobile-insurance policy was not in force on the date of his collision with Hziah Chia and that it had, in fact, been canceled on October 25, 1972.
After both parties rested, the trial justice granted Allstate's motion for directed verdict on a number of grounds. Although Allstate did not raise a Rule 17(a) issue, the trial justice did so on his own and held that plaintiff had violated Rule 17(a) of the Superior Court Rules of Civil Procedure in that he was not the real party in interest. The trial justice found that plaintiff had assigned any contractual right he may have had against Allstate to Hziah Chia as partial satisfaction of Chia's negligence action against him. Since there was no evidence that plaintiff was bringing this action against Allstate on behalf of or for the benefit of Hziah Chia, the trial justice held that plaintiff had no right to bring the contractual action against Allstate.
The Superior Court Rules of Civil Procedure were designed "`to secure the just, speedy, and inexpensive determination'" of the rights and liabilities of the litigants in every action in the Superior Court. Esquire Swimming Pool Products, Inc. v. Pittman, 114 R.I. 238, 240, 332 A.2d 128, 130 (1975). Rule 17(a) provides that "[e]very *627 action shall be prosecuted in the name of the real party in interest." The rationale behind the rule is that defendants must be allowed to insist upon being opposed by the real party in interest so as to protect themselves from further suits regarding the same claim. See Advisory Committee Note to 1966 Amendment to Fed.R.Civ.P. 17(a).
A Rule 17(a) objection should be raised as early as possible to give the challenged party time to prepare an answer or to amend its complaint to substitute the proper party. See Pittman, 114 R.I. at 240, 332 A.2d at 130. Consequently, the rule has been seen, in many respects, to be similar to an affirmative defense. Id. Failure to raise a real-party-in-interest objection reasonably promptly may result in a defendant's being deemed to have waived his or her right to raise this objection. Id. (citing 1 Kent, R.I.Civ.Prac. § 17.1 (1969); 6 Wright & Miller, Federal Practice & Procedure: Civil § 1554 (1971)). The determination of reasonable promptness, however, may vary with the circumstances of each case and should rest within the sound discretion of the trial justice. 114 R.I. at 240, 332 A.2d at 130 (citing 3A Moore, Federal Practice ¶ 17.15-1 (2d ed. 1967); 6 Wright & Miller, at § 1554).
We do not hold that a real-party-in-interest objection may only be made by the defendant, nor do we hold that the objection must be made before trial or be waived. In fact, courts should be allowed as much discretion as possible in handling real-party-in-interest objections. See Levinson v. Deupree, 345 U.S. 648, 73 S.Ct. 914, 97 L.Ed. 1319 (1953); Link Aviation, Inc. v. Downs, 325 F.2d 613 (D.C. Cir.1963); Advisory Committee Note to 1966 Amendment to Fed.R.Civ.P. 17(a); J. Friedenthal, M. Kane, A. Miller, Civil Procedure, 322 (West 1985). In Esquire Swimming Pool Products, Inc., we applied Rule 17(a) to prevent the defendant from withholding his real-party-in-interest objection "until the eleventh hour in order to entrap the plaintiff." 114 R.I. at 241, 332 A.2d at 130. In the present case, it does not appear, however, that defendant was ever aware of any real-party-in-interest objection. We find, therefore, that the trial justice could properly raise the issue.
Once the real-party-in-interest issue is raised, however, the case should not be dismissed until the challenged party has been given a reasonable time to answer the objection or substitute the proper party. See Advisory Committee Note to 1966 Amendment to Fed.R.Civ.P. 17(a). The function of Rule 17(a) is to protect the defendant against subsequent action by the party actually entitled to recover and to ensure generally that the judgment will have its proper effect as res judicata. Its use should not produce an unjust result that denies real parties in interest their chance to maintain an action. Under Rules 15 and 21 of the Superior Court Rules of Civil Procedure, the real party in interest may be added or substituted upon appropriate motion. Amendments may be allowed even if at the time of the amendment the statute of limitations would bar an independent action by such party. 1 Kent, R.I.Civ. Prac. § 17.1 (1969). The action should be dismissed only if the real party in interest is not substituted. Furthermore, a dismissal on such grounds is not a dismissal on the merits, and an action may later be brought on the same claim by the real party in interest. See J. Friedenthal, M. Kane, A. Miller, Civil Procedure, at 323.
Secondly, the trial justice went on to find that plaintiff failed to produce any evidence upon which a reasonable jury could find that Milton Abrams, as Allstate's agent, had authority to grant a payment grace period to plaintiff. Accordingly, the trial justice directed a verdict for defendant Allstate on plaintiff's contract claim.
When reviewing the granting of a motion for directed verdict, we are bound by the same rules that govern the trial justice. We examine all the evidence in a light most favorable to the nonmoving party without considering the weight of the evidence or the credibility of the witnesses. The nonmoving *628 party must be given the benefit of all reasonable and legitimate inferences that may properly be drawn from the evidence. If such examination reveals issues upon which reasonable minds could differ, then the motion for directed verdict should be denied and the jury should be left to determine the issues of the case. Souza v. Narragansett Council, Boy Scouts of America, 488 A.2d 713, 714-15 (R.I. 1985) (citing Marcotte v. Harrison, 443 A.2d 1225, 1229 (R.I. 1982)). With these considerations in mind, we have reviewed the evidence and conclude that the granting of the motion was not correct.
"To establish the apparent authority of an agent to do a certain act, facts must be shown that the principal has manifestly consented to the exercise of such authority or has knowingly permitted the agent to assume the exercise of such authority; that a third person knew of the fact and, acting in good faith had reason to believe and did actually believe that the agent possessed such authority; and that the third person, relying on such appearance of authority, has changed his position and will be injured or suffer loss if the act done or transaction executed by the agent does not bind the principal." Soar v. National Football League Players Association, 438 F. Supp. 337, 342 (D.R.I. 1975), aff'd, 550 F.2d 1287 (1st Cir. 1977).
"[T]he existence and scope of an agency relationship is essentially a factual determination," Petrone v. Davis, 118 R.I. 261, 266, 373 A.2d 485, 487 (1977) (citing American Underwriting Corp. v. Rhode Island Hospital Trust Co., 111 R.I. 415, 420, 303 A.2d 121, 124 (1973)), and is within the province of the jury. The evidence in this case raises a question about the extent of Milton Abrams's authority to bind Allstate. The plaintiff testified that Abrams told him not to worry, that he had time to make a payment on his policy. Looking at the evidence in a light most favorable to plaintiff, he had thirty-one days after October 25, the cancellation date, in which to make a payment. The evidence shows that Mr. Martynik questioned Allstate's potential liability on the insurance contract. He appeared to be waiting for word from Abrams before he informed plaintiff that Allstate would not pay the claim. This deference to Abrams could give rise to an inference that Allstate recognized Abrams's authority to extend a payment date. It seems, therefore, that there was evidence upon which reasonable minds could differ and the issue should have been submitted to the jury.
Finally, the trial justice addressed plaintiff's bad-faith claim.[1] This action, sounding in negligence, was properly brought in plaintiff's name. The trial justice found, however, that plaintiff failed to present any evidence to support his bad-faith claim. Accordingly, defendant's motion for directed verdict was also granted on that issue.
In Bibeault v. Hanover Insurance Co., 417 A.2d 313 (R.I. 1980), we recognized an independent tort claim based on an insurer's violation of its implied-in-law duty to act in good faith in its relationship with its policyholders. Id. at 319. Our recognition of this tort did not, however, imply that whenever a company loses a dispute in court regarding the validity of a claim, it breaches this duty. Id. "If a claim is `fairly debatable,' no liability in tort will arise." Id.
"To show a claim for bad faith, a plaintiff must show the absence of a reasonable basis for denying benefits of the policy and the defendant's knowledge or reckless disregard of the lack of a reasonable basis for denying the claim. It is apparent, then, that the tort of bad faith is an intentional one." Id. (quoting Anderson v. Continental Ins. Co., 85 *629 Wis.2d 675, 691, 693, 271 N.W.2d 368, 376-77 (1978)).
The trial justice held that since "there was a substantial and genuine question with respect to coverage which this court finds was decided correctly by Allstate, there can be no evidence of bad faith in this case for a jury to decide." See DiIorio v. Abington Mutual Fire Insurance Co., 121 R.I. 689, 697, 402 A.2d 745, 749 (1979). We agree. The evidence in the present case fails to satisfy the bad-faith test set by this court in Bibeault. Since the evidence gives rise to a valid question of coverage, it follows that Allstate could not have acted in bad faith. The trial justice was correct in directing a verdict for Allstate on that issue.
For these reasons, the plaintiff's appeal is sustained in all aspects save the direction of verdict on the plaintiff's bad-faith claim; that portion of the judgment is affirmed; and the papers of the case are remanded to the Superior Court for a new trial on the remaining issue.
NOTES
[1]  The plaintiff's complaint contained no allegation of bad faith and no amendment was made. The trial justice found, however, that the complaint could be interpreted to contain an allegation of bad faith.
