
492 Pa. 343 (1980)
424 A.2d 1222
COMMONWEALTH of Pennsylvania
v.
William Francis HIGGINS, Appellant.
Supreme Court of Pennsylvania.
Argued January 22, 1980.
Decided April 30, 1980.
Reargument Denied February 18, 1981.
*344 *345 Denis V. Brenan, Philadelphia, for appellant.
William T. Nicholas, Dist. Atty., Ronald T. Williamson, Chief, Appellate Div., Asst. Dist. Atty., for appellee.
Before O'BRIEN, ROBERTS, NIX, LARSEN and FLAHERTY, JJ.

OPINION
NIX, Justice.
Appellant, William Francis Higgins, on October 7, 1977, entered a plea of guilty to murder of the third degree, 18 Pa.C.S.A. § 2502(c) (Supp. 1978-79) criminal attempt to murder, 18 Pa.C.S.A. § 901 and aggravated assault, 18 Pa.C.S.A. § 2702. Pursuant to the bargain which prompted the plea[1] the degree of murder was reduced from first degree to third degree and a nol. pros. was entered upon the indictments charging recklessly endangering another person, 18 Pa.C.S.A. § 2705 and possession of instruments of crime 18 Pa.C.S.A. § 907. The agreed upon sentence was not less than 10 nor more than 20 years imposed on the murder bill and a consecutive sentence of 5 to 10 years on the attempted murder bill. The sentence was suspended on the aggravated assault charge. Appellant presently contends: a) that the trial court should have permitted a withdrawal of his plea of guilt; b) that the court should not have accepted the entry of a plea of guilt where the defense of insanity was readily apparent; c) that he was incompetent at the time of the entry of the plea; and, d) that he did not receive effective assistance of trial counsel.
On the evening of January 30, 1977, Michele Connella was shot in the back and killed by appellant as he exited from his *346 truck in the parking lot of Gus's Diner in Norristown, Pennsylvania. After shooting Mr. Connella, appellant fired several other shots into the diner. One of the patrons, Harry Bufo was seriously injured from glass and metal caused by one of the bullets which had been fired into the diner. After firing the four shots, appellant went to his vehicle and drove home. Appellant did not know the victims and had no reason to shoot them.
A review of the procedural history reveals that the instant appeal was untimely filed. The judgment of sentence was entered following the entry of the pleas on October 7, 1977. At the time of the imposition of sentence, the on the record colloquy establishes that appellant was advised that an appeal to a higher court would have to be taken within thirty days of that date. An appeal was not filed in this Court within the thirty day period and appellant has failed to offer any reason for his failure to timely file.
To the contrary, rather than seeking a direct review of his appeal in this Court, appellant petitioned the trial court for the right to withdraw his pleas of guilt. This motion was filed November 30, 1977. The instant appeal purports to be an appeal from the court's denial of that request and was filed within thirty days of the court's rejection of the motion to withdraw the pleas.
In Commonwealth v. Starr, 450 Pa. 485, 301 A.2d 592 (1973), we clarified the power of the court to consider a motion to withdraw a plea of guilty after sentencing under Pa.R.Crim.P. 320.[2] In Starr, we noted that although the language of rule 320 might suggest that it was confined to pre-sentence applications, prior case law dictated a holding that post-sentence applications could also be entertained under the rule. Decisions following Starr pointed out that the proper method of challenging a plea of guilty was to file a petition to withdraw the plea in the trial court. See Commonwealth v. Lee, 460 Pa. 324, 327n, 333 A.2d 749, 950n *347 (1975); Commonwealth v. Zakzewski, 460 Pa. 528, 531, n1, 333 A.2d 898, 900, n1 (1975). In Lee, we noted the "uncertainty which [had] prevailed as to the appropriate method by which to attack a guilty plea, as well as the absence of a definitive procedural rule on the subject, . . ." Id. To avoid further confusion, we promulgated rule 321 which was adopted June 29, 1977, effective September 1, 1977.
Rule 321 provided:[3]
"(a) A motion challenging the validity of a guilty plea, the legality of a sentence on a guilty plea or the denial of a motion to withdraw a guilty plea shall be in writing and shall be filed with the trial court within ten (10) days after imposition of sentence.
(b) The motion shall be disposed of promptly.
(c) The trial court may schedule a hearing on the motion and shall determine whether the motion shall be argued before one judge alone or before a panel of judges sitting as a court en banc. Whenever a single judge hears the motion alone, the judge may make any ruling that could be made by a court en banc."
The explanatory comment to the rule states that "[a] denial of a motion to withdraw a guilty plea under Rule 320 may not be appealed until such denial has first been challenged under this rule." Thus, not only was any prior uncertainty eliminated by the adoption of rule 321, this new provision also set forth a time limit in which such a challenge must be raised. The effect of rule 321 was to bring challenges upon guilty pleas in conformity with the practice where there has been a verdict of guilt entered by requiring that the complaint in the first instance be made to the trial court, thereby giving that court the opportunity to consider and correct the asserted error.
*348 Prior to the adoption of rule 321, which mandates that motions to withdraw a plea of guilty must be made within 10 days of sentencing, we formerly followed a due diligence approach. See Commonwealth v. Rosmon, 477 Pa. 540, 542-43 n1, 384 A.2d 1221, 1222-23 n1 (1978); Commonwealth v. Bunch, 466 Pa. 22, 351 A.2d 284 (1976). Such an approach here would not be appropriate since rule 321 was controlling at the time that this sentence was imposed.[4] Thus the court below should have dismissed appellant's petition as untimely and not in compliance with the provisions of rule 321.[5]
As previously stated, appellant was advised on the record that he was to file his appeal to this Court within thirty days from the date of the imposition of sentence.[6] His unexplained failure to timely file an appeal cannot be rectified by the filing of an untimely challenge to his plea of guilty. To hold otherwise would reward him for compounding the error. The trial judge recognized the procedural difficulty and attempted to surmount it by treating appellant's motion as a petition for P.C.H.A. relief.[7]
The difficulty with this solution is that normally a finding of a knowing and voluntary waiver of direct appeal *349 rights also forecloses P.C.H.A. consideration of the issues. See § 4, 19 P.S. 1180-4. Ordinarily the inquiry would terminate at this point and a ruling that further review has been foreclosed would be appropriate. However, appellant has raised two questions which do require further consideration. First, appellant contends that he was incompetent at the time of the entry of plea and sentencing. We have consistently held that mental competency to participate in a proceeding is not waivable and can be considered whenever raised. Commonwealth v. Tyson, 485 Pa. 344, 402 A.2d 995 (1979); Commonwealth v. Silo, 469 Pa. 40, 364 A.2d 893 (1976); Commonwealth v. Marshall, 456 Pa. 313, 318 A.2d 724 (1974). Second, appellant has charged his trial counsel with incompetency and this is the first opportunity since gaining new counsel he has had to raise that issue. Commonwealth v. Faison, 437 Pa. 432, 264 A.2d 394 (1970); Commonwealth v. Levenson, 225 Pa.Super. 318, 303 A.2d 838 (1973).
The trial court made a specific finding that appellant was competent to enter the plea of guilty. We are, therefore, required to examine the record to determine whether it supports that finding. We are satisfied that it does. The test for determining competency has been frequently stated:
"The test to be applied in determining the legal sufficiency of [a defendant's] mental capacity to stand trial, or enter a plea at the time involved, is not the M'Naghten `right or wrong' test, but rather his ability to comprehend his position as one accused of murder and to cooperate with his counsel [in making a rational] defense."
Commonwealth v. Melton, 465 Pa. 529, 534, 351 A.2d 221, 224 (1976). See also Commonwealth v. Tyson, 485 Pa. 344, 402 A.2d 995 (1979).
On April 5, 1977, the court ordered an examination of the appellant to discern his competency to stand trial. Defense counsel was authorized by the court to retain a psychiatrist of his choice to conduct the examination. A petition for involuntary treatment was filed by the defense and approved by the court pursuant to which the appellant was *350 transferred to the Norristown State Hospital pending trial. Dr. Boxer, a certified psychiatrist, who had previously examined the appellant in 1969 diagnosed his condition as schizophrenic reaction, paranoid type. He further opined that with medication, appellant could understand the nature of the proceedings against him, that he had the capacity to confer with counsel and that he could participate in his defense at trial. It was as a result of this testimony that the court approved the commitment to Norristown State Hospital to allow for further examinations and evaluation and to assure that proper medication was prescribed and taken.
While the record establishes that the malady is chronic and of long duration there is nothing in this record to dispute Dr. Boxer's opinion as to appellant's competency. In reaching this conclusion, we are mindful of the fact that Dr. Boxer, who was selected by the defense, was familiar with appellant's case.[8] That as a result of his commitment to the State Hospital at Norristown, after the competency determination, the defense had available any contradictory information *351 that may have been part of the records of the hospital. As the trial court in its opinion properly noted: "No additional or different psychiatric testimony was presented at that time (date of sentence), although the [appellant] or his counsel were at liberty to do so had that seemed necessary or useful." (Slip opinion pg. 9) We also recognize that in spite of this condition, appellant has achieved as a graduate of the University of Scranton and has done post-graduate work at Boston College and Temple University.[9] Finally, the extensive colloquy with the appellant at the time of the entry of the plea demonstrates his complete awareness and his ability at that time to fully participate in the proceeding.
We are, therefore, satisfied that the record supports the court's finding that appellant was competent to enter the plea.
Finally, we must consider appellant's claim of ineffective assistance of trial counsel. Specifically, he argues that counsel should not have counselled him to accept the plea bargain agreement since he had a complete defense, i.e., insanity. Unquestionably, there was evidence that would have supported a theory that the shootings were a product of delusional thinking. Yet the record does not establish as a matter of law the absence of criminal responsibility under the M'Naghten test. Commonwealth v. Bruno, 466 Pa. 245, 352 A.2d 40 (1976); Commonwealth v. Hamilton, 459 Pa. 304, 329 A.2d 212 (1974); Commonwealth v. Demmitt, 456 Pa. 475, 321 A.2d 627 (1974).[10] As a result of the plea agreement, appellant received a nol. pros. on two charges for which he could have been held accountable and sentenced. *352 Most importantly, there was evidence which, if believed, would have sustained a verdict of murder of the first degree. Under these circumstances, it cannot be said that trial counsel did not have a reasonable basis for recommending the plea agreement. See, Commonwealth v. Musi, 486 Pa. 102, 404 A.2d 378 (1979); Commonwealth v. Sullivan, 472 Pa. 129, 371 A.2d 468 (1977); Commonwealth ex rel. Washington v. Maroney, 427 Pa. 599, 235 A.2d 349 (1967).
Judgment of Sentence affirmed.
EAGEN, C.J., did not participate in the decision of this case.
ROBERTS, J., concurred in the result.
NOTES
[1]  The decision to enter a plea of guilt came only after twelve jurors and one alternate had been selected.
[2]  Pa.R.Crim.P. provides: "At any time before sentence, the court may, in its discretion, permit or direct a plea of guilty to be withdrawn and a plea of not guilty substituted."
[3]  In an effort to implement the directives set forth in Commonwealth v. Riggins, 474 Pa. 115, 377 A.2d 140 (1977), we adopted rule 1410 and amended rule 321 along with rules 1405 and 1409. Attacks upon the legality of the sentence was provided for under 1410 and the amendment to 1409 thus rendering the reference to such attacks in rule 321 superfluous. Thus we deleted the words "the legality of a sentence on a guilty plea." See amendment adopted May 22, 1978, effective July 1, 1978.
[4]  Interestingly, appellant offers no excuse for the untimely filing of his motion, but, rather, asserts that "[o]n November 30, 1977, petitioner [sic] timely filed a Petition for Allowance to Withdraw the Guilty Plea." [Appellant's brief pg. 16]
[5]  Although rule 321 does not expressly state that the appeal of challenges to the guilty plea are limited to the claims asserted under this rule, this is now the case. Thus the procedure under Rule 321, as affected by rule 1405(c)(2), parallels the procedure under Rule 1123. As in the case of the practice under rules 1123 and 1405, the trial court has the responsibility at the time of the sentencing colloquy to advise the defendant of his rights if he fails to comply with the provisions of that rule.
[6]  The time for filing an appeal commences on the date of the final order deciding the motion under rule 321. See n.5. See also Pa.R. A.P. 343.
[7]  Post Conviction Hearing Act, 1966, January 25, P.L. (1965) 1580, §§ 1 et seq., 19 P.S. §§ 1180-1 et seq. (1979-80 Supp.)
[8]  At the hearing on the petition for involuntary treatment held on June 6, 1977, Dr. Boxer testified:

"Q. Doctor, just briefly would you tell us the background of Mr. Higgins as you determined it?
A. Well, Mr. Higgins has represented a chronic psychosis of many year's duration. I have known him  I evaluated him in 1969, and I have conferred with other psychiatrists who treated him, particularly the late Dr. Joseph Peters, who saw him at the institute, the University of Pennsylvania, many years ago, which further confirms the chronicity of his major mental illness.
Q. And have you diagnosed his mental illness?
A. Yes, sir.
Q. And what is that?
A. Schizophrenic reaction, paranoid type.
Q. Now, in your discussions or conferences with Mr. Higgins, did you ascertain whether or not he appreciates the nature and quality of the proceedings against him?
A. Yes, sir.
Q. And does he appreciate those things?
A. Yes, he does.
Q. Is he, in your opinion, able to confer with me and participate in his defense of the case at this time?
A. Yes, sir.
Q. And it is your opinion that he's competent to proceed to trial at this time; is that correct?
A. That's correct."
[9]  Appellant implicitly accepts that the voluminous medical evidence does not support his present contention. Rather, he attempts to argue that his medical history required a psychiatric evaluation "contemporaneous with his tender of a guilty plea. . . ." [Appellant's brief, pg. 23].
[10]  Although appellant's statement to the police at the time of arrest has overtones of delusional thinking, there are statements contained therein which would support the view that he acted knowing the nature and quality of his act and proceeded with the realization that it was wrong.

Q. What do you think will happen to you now?
A. God knows. I don't know. What do I think will happen to me now? Well, if I get better, if people decide or if a doctor decides I'm sick or whatever, then I'll try to continue my studies. If not then I'll have to do whatever the doctors say. That's why I was going to get the prescription. I was feeling a little upset.
Q. Do you think it was against the law to kill someone?
A. Well, there is the fifth commandment, `Thou shalt not kill' and that's religious, and, of course, it's not legal to go around shooting people. Well, I shot him because I felt I had to or wanted to. I really did want to. [N.T. 18a].
