Think back to the very first moment when you knew you wanted to be a doctor. When did it happen? What did you picture for your future?

Odds are that your youthful dreams did not include crushing medical school debt or the stress that so often accompanies it. And yet, research indicates that 52% of residents have over $200,000 in debt, with family medicine residents being hit particularly hard by debt that seems immense compared to their annual salaries. With the prospect of debt stretching decades into the future, it’s only natural that more students find themselves choosing a medical specialty associated with higher salaries. Unfortunately, these specialties often have nothing to do with the reason they got into medicine in the first place.

It’s difficult to ignore the impulse to change your medical specialty. Let’s say you’re thinking about becoming a pediatrician, which on average earns $221,000 per year, according to Medscape’s Family Physician Compensation Report 2021. Compare that with $275,000 in debt and you can see why many students switch to more lucrative specialties.

So why is this a problem? Well, chances are that you didn’t decide to go into medicine for the money, so don’t let dollar signs drive your career path now. Here are a few things to remember as you jump back in the driver’s seat, push your debt into the rear view mirror, and still allow your practical side to be a passenger.

Doing what you love will help you be the best at what you do

Let’s think back to those medical dreams you had when you first decided to be a doctor. Not only did those specifics in specialty provide you with a sense of purpose, but they likely cultivated sense of empathy for a particular audience you anticipated serving. In other words, you cared deeply, and when you switch to a specialty in which you are invested for purely financial reasons, it’s all too easy for that empathy to be replaced by cynicism. If you lack passion, it may become all too easy for you to “phone it in” instead of doing your best work.

A fulfilling medical career is so much more than a paycheck

When choosing a medical specialty, overall quality of life cannot be ignored, and different medical specialties often compensate for higher salaries with long hours or increased paperwork. The residents surveyed by Medscape in its 2021 Residents Salary & Debt Report based their answers not just on compensation and debt but on the hours they work, professional relationships, quality of education, and ability to maintain a healthy work-life balance.

If you dreamt of psychiatry or family medicine, you may not be prepared for the lifestyle accompanying a general surgery medical specialty. In fact, despite the great difference in salary, far more family medicine physicians than surgeons professed overall career satisfaction, according to a recent survey.

Long-term financial gain is based on more than starting salary

While there are no easy solutions to the problem of medical school debt, take comfort in the fact that medical specialty salaries change.

And with advances in technology, specialties such as family medicine, radiology and sports medicine are expected to thrive in the future. According to Humanitas University, technology like chatbots, wearable devices and AI programs can help physicians by doing easy or repetitive tasks so they can focus on complex problems and spend more time with their patients.

In the long run, the greater demand and job security of some specialties may balance out with the short-term salary boost of others. And while it may not be clear to you as a student or resident that your debt is indeed manageable, the income of the average doctor over time is enough to cover the debt of the average doctor.

There are solutions

Rather than pursuing an ill-fitting specialty and abandoning your passion, a little research can reveal many options. There are solutions such as relocating to a rural area where money goes further, moving to a state with a loan repayment program or joining the National Health Service Corps. Another option is to refinance your student loans at a lower interest rate.

So, increasing your salary through a change in specialty is only one solution and it may not be the best one for you. There are other solutions that can preserve your bank account as well as your ideals.