On November 5, 1946, relator was arrested and charged with assault and battery with intent to commit rape. After preliminary hearing, relator was released on bail. On June 6, 1947, at No. 202, December Sessions, 1946, Court of Quarter Sessions of Allegheny County, relator was tried and found guilty of that offense. Sentence was deferred and relator was granted bail pending disposition of his motions and sentence.
While on bail relator was arrested and charged with contributing to the delinquency of a minor and with public indecency. After preliminary hearing on these subsequent charges, relator was committed on August 1, 1947, to the Allegheny County Jail in default of bail for those charges. On October 31, 1947, he pleaded guilty to the charges of contributing to the delinquency of a minor and public indecency at Nos. 51 and 52, September Sessions, 1947. Sentence thereon was also deferred, and on that day relator was committed to the Pennsylvania Institution for Defective Delinquents at Huntingdon for treatment. See Act of May 25, 1937, P. L. 808, as amended, 61 PS §541 — 1 et seq. It was provided that relator be returned to Allegheny County for sentence upon his release from the institution at Huntingdon. On July 6, 1948, upon petition of the Attorney General and upon the recommendation of the Board of Trustees of the Pennsyl*248vania Institution for Defective Delinquents to the effect that relator was not insane or a defective delinquent and should be released for recommitment to a suitable institution according to law, the court ordered that relator be released from said institution into the custody of the Sheriff of Allegheny County and be returned to the Allegheny County Jail to await further disposition by the court.
On September 13, 1948, the relator was brought before the Court of Quarter Sessions of Allegheny County on each of the three convictions and placed on probation for a period of five years in the custody of his sister Avho resided in Wheeling, West Virginia. One of the conditions of probation was that relator leave the State of Pennsylvania and not return during the period of probation. He ivas arrested in McKeesport, Pennsylvania, on other charges on December 17, 1948, and on December 21, 1948, probation was revoked and he was sentenced to a term of not less than two and one-half years nor more than five years in the Allegheny County Workhouse at No. 202, December Sessions, 1946. On bill No. 51, September Sessions, 1947, relator was sentenced to a term of three years to begin and take effect upon the expiration of the sentence imposed at No. 202, December Sessions, 1946. The sentence on bill No. 52, September Sessions, 1947, was suspended.
Kelator filed a petition for a Avrit of habeas corpus on September 16, 1953, in the Court of Common Pleas of Allegheny County; a rule to show cause was issued and a hearing, at which relator was present and represented by counsel, was held October 5, 1953. This appeal is from the final order of the court below directing a modification as to the effective date of the sentence imposed at No. 202, December Sessions, 1946, *249discharging the rule and refusing the writ. See Com. ex rel. Spanos v. Keenan, 102 P. L. J. 159.
At the hearing relator’s counsel and the District Attorney of Allegheny County agreed and the court decided that there was no merit, with one exception, in relator’s contentions. With this we agree and we see no reason to discuss the other contentions. We do, however, find merit in the contention that the sentences imposed were illegally computed.
The question presented is whether relator should have been given credit for confinement previous to final disposition of bills No. 202, December Sessions, 1946, and No. 51, September Sessions, 1947. At the hearing the district attorney agreed that relator was entitled to such credit. The court below in determining that relator was entitled to credit on bill No. 202 stated: “. . . the Act of 1937, P. L. 1036, section 1 (19 PS 894) in substance provides that a defendant is entitled to credit for the period during which he is held in custody pending disposition of the charges brought against him and on this basis he would be entitled to credit for the whole period of detention, including that while he was in restraint at the institution for mental defectives.”
The court below properly computed the credit to be allowed relator on bill No. 202. But relator is entitled to credit on bill No. 51 for the time he was confined in the county jail prior to being sent to the institution for mental defectives at Huntingdon, that is, from August 1, 1947, to October 31, 1947. See Com. ex rel. Lerner v. Smith, 151 Pa. Superior Ct. 265, 30 A. 2d 347.
We are of the opinion that there should be a correction of relator’s sentence on bill No. 202 as to the effective date although the sentence may have been *250served, because tbe sentence on bill No. 51 was to begin after completion of tbe sentence on bill No. 202.
This Court has the power to amend a sentence of the court of quarter sessions or of the court of oyer and terminer so that it conforms with the law.1 Com. v. Downer, 161 Pa. Superior Ct. 339, 344, 53 A. 2d 897.
And now, August 30, 1954, it is therefore adjudged that the sentence heretofore imposed upon relator by the Court of Quarter Sessions of Allegheny County, at No. 202, December Sessions, 1946, be amended so as to make the effective date as of February 3, 1948; it is also adjudged that the sentence heretofore imposed upon relator by said court, at No. 51, September Sessions, 1947, be amended as of the date of imposition by giving credit for the period of relator’s detention in the Allegheny County Jail from August 1, 1947, to October 31, 1947, notwithstanding that such sentence was to take effect upon the expiration of sentence imposed on bill No. 202. Eespondent may treat the commitments under which he holds relator as though they had been amended accordingly.
In other respects the order of the court below is affirmed.
See Com. ex rel. Madden v. Ashe, 162 Pa. Superior Ct. 39, 45, 56 A. 2d 335; Com. ex rel. Westwood v. Gackenbach, 169 Pa. Superior Ct. 637, 641, 84 A. 2d 380.