Opinion by
Woodside, J.,The petitioner in this habeas corpus case seeks release from the Eastern State Correctional Institution *512(formerly Eastern State Penitentiary) on a writ of habeas corpus filed in the Court of Common Pleas of Allegheny County. After taking testimony and hearing argument, that court dismissed the writ. The prisoner appealed.
The petitioner does not question a sentence of 2% to 5 years imposed in Allegheny County on April 26, 1957, for assault and battery with intent to rape. He does question a sentence of 5 to 10 years imposed for burglary. The sentencing judge directed that the sentence for burglary should run concurrently with the sentence for assault, the maximum of which does not expire until April 25, 1962. As the release of a prisoner prior to the expiration of his maximum sentence is a matter of grace within the discretion of the Pennsylvania Board of Parole, it can legally detain the appellant on the assault charge until the expiration of five years. Commonwealth ex rel. Haun v. Cavell, 190 Pa. Superior Ct. 346, 349, 154 A. 2d 257 (1959); Commonwealth ex rel. Salerno v. Banmiller, 189 Pa. Superior Ct. 156, 161, 149 A. 2d 501 (1959).
There is no allegation or evidence that the Pennsylvania Board of Parole has paroled the petitioner from the assault sentence. Therefore, the petitioner is now legally detained in a state penal institution, and is not entitled to release by the courts on a writ of habeas corpus regardless of the legality of the burglary sentence. If the petitioner is legally detained in prison, he is not entitled to a writ of habeas corpus. Before he is entitled to the writ, hé must show that he has a right to be discharged or released on bail. Commonwealth ex rel. Salerno v. Banmiller, supra, 189 Pa. Superior Ct. 156, 160, 149 A. 2d 501 (1959).
The appellant alleges that he was denied counsel of his own choosing, and that he was particularly prejudiced in this denial because he might have been able to establish a mental condition at the time of trial *513which would have made him legally incompetent to stand trial, and a mental condition at the time of the commission of the offense which might have entitled him to acquittal on the ground of insanity.
The petitioner is a Korean War veteran who had been awarded a 100% service connected disability by the Veterans Administration for a “mental disorder.” He had been in the Veterans Administration Hospital for a mental disorder until January 24, 1955, when he walked away from the hospital without a discharge.
He had employed a Pittsburgh lawyer and paid her $200 to defend him in the burglary case. When the case was called for trial, she was in Florida, and he went to trial with a court assigned attorney. The trial resulted in a conviction. Two days later the counsel, whom he had retained, returned from Florida and interviewed him. Subsequently, with the petitioner present, she argued a motion for a new trial before the court en banc. The motion for a new trial was refused and sentence was imposed. No appeal was taken.
President Judge Rodgers, who sentenced the petitioner while specially presiding in Allegheny County, heard this habeas corpus case and took testimony on the merits of the petitioner’s contentions. In its opinion, the court dealt extensively with the merits of the habeas corpus case and found, among other things, that the petitioner was well represented by able counsel in the burglary case and did not complain to the court at that time about the counsel who represented him, nor did he seek a continuance of the trial on the burglary charge.
All questions raised in the habeas corpus case could have been raised on appeal. A writ of habeas corpus is not a substitute for an appeal, or for a writ of error, or for a motion for a new trial, or for the correction of trial errors. Commonwealth ex rel. Murray v. Keenan, 186 Pa. Superior Ct. 107, 109, 140 A. 2d 361 (1958); *514Commonwealth ex rel. Wilkins v. Banmiller, 401 Pa. 347, 164 A. 2d 333 (1960).
As the prisoner is not entitled to a writ of babeas corpus because be is now legally imprisoned on tbe assault sentence and because the questions presented here could bave been raised on appeal and are therefore not properly before us, it is not necessary to consider tbe merits of bis contentions, all of wbicb were carefully reviewed, discussed and decided against tbe petitioner by tbe court below.
Order affirmed.