To hell with those fitness memes, we know we never skip leg day. A well-rounded training program includes training the upper body and lower body, so if you regularly train legs in your routine, you’re on the right track.

The only problem is that lower back pain after squats can really mess up your workout routine, causing you to switch your setup in the squat rack to curls. If your form is incorrect while doing squats, you won’t be feeling the burn in your quads, glutes, and calves — you’ll be feeling it in your lower back as well. And if it worsens, it can keep you out of the gym for a long time.

Here’s what you need to know about lower back pain after doing squats.

Why your back hurts when you squat

First things first, you need to understand the mechanics of your body, when you both initiate a squat movement and when you come back up.

 “Descent is both maximal hip and knee flexion, and the ascent is hip and knee extension,” says Tony Gentilcore, C.S.C.S., founder of CORE in Boston. ” As we descend into a squat, the hamstrings lengthen at the hip joint and shorten at the knee joint.” At the same time, your upper back muscles fire, which helps you maintain an upright torso so your back doesn’t round.

That’s what should be going on when you squat. But if your form is off, it can lead to lower back pain after squats.

“Having more awareness and attention to detail to getting and maintaining full-body tension (abs on, upper back tightness, even foot placement and pressure) will go a long way in making the squat feel better,” says Gentilcore.

“Some people just aren’t built to go deep.”

If you don’t “fire,” or brace, your abs and your lats when you’re squatting, your back will round instead of maintaining an upright torso, and that can lead to back pain. Your foot placement can also play a role: if your feet are turned out at an angle, you’re putting your hips and knees at a higher risk of injury. Your knees become wobbly due to your arches collapsing, which will hurt your form and lead to back pain.

It’s also possible that you could be overshooting what your body can actually handle when squatting.

“The internet likes to tell guys that squatting deep (or ass to grass) is the only way to squat. Depth is arbitrary, and for some, going too deep can be detrimental. Some people just aren’t built to go deep,” says Gentilcore. In fact, going too deep wreaks havoc on your knees and puts extra stress on your back and spine, which can put you at risk for serious injury.

Your squat variation can lead to back pain

The type of squat you’re doing could also be the culprit. Barbell backsquats are the most common offenders, says Gentilcore. Because you’re loading the weight across your back, if you go too heavy, you put more pressure on your spine to do the work.

“Back squats are the most advanced version of squats, and if someone doesn’t possess the requisite mobility in the right areas (mid-back, shoulders, hip flexors), they could be problematic,” says Gentilcore.

How to prevent back pain when you squat

First, choose a squat variation that’s right for you.”Starting with less aggressive and more user-friendly variations like goblet squats (above) or front squats is usually the answer.” says Gentilcore. “In both cases, most guys are in a better, more upright position that takes stress off the back and spine.”

Then, before you begin your squat, make sure your feet are facing forward and your chest is up, as a more upright position will take stress off the back/spine, says Gentilcore.

Feel like something is off? Ask a certified trainer or strength coach to check out your form, suggests Gentilcore. They can give you a proper assessment and audit your technique.

When the pain gets better, you can get back to lifting—just play the preventive game to make sure it doesn’t hit again. A 2016 study found that a combination of exercises, such as flexibility training and core stabilization, may be most helpful to people with lower back pain, especially those that improve the flexibility of your lumbar spine and hamstrings. So try to incorporate classes like yoga, Pilates, or tai chi into your routine.

If pain persists for more than a week after resting, it’s time to have a doctor check you out, says Gentilcore. They can make sure you haven’t done any lasting damage.