If the security deposit is the only loss,
I would just move out and get better sleep. But you need to make sure that is the only thing you will lose. Some rental agreements provide for a full year of payment no matter when you move out. Don't forget to give written notice.
In the alternative, you need to consult a PA lawyer to determine if this aparment is hatibable under PA law. That will cost money, probably more than the security deposit.