In 2013, 179,000 bariatric surgeries were performed in the United States alone. As the obesity epidemic continues to grow, more and more individuals are considering the surgery as a treatment option. And while most patients do see significant weight loss immediately after surgery, continuing to lose weight — and keep it off — can be a challenge.

According to the American Society for Metabolic and Bariatric Surgery upwards of 50 percent of patients regain 5 percent of their body weight within 2 years of undergoing the procedure, while a smaller percentage of patients may gain back even more. So what can be done to increase the success rate of weight-loss surgery? Experts on the topic and individuals who have achieved long-term success with the treatment agree on this: Surgery is only the first step. The secret to permanent weight loss is to make lifestyle changes that stick. Here are five vital steps to prevent gaining weight back after undergoing bariatric surgery.

1. Get post-op support for long-term success. “Bariatric surgery is an emotional roller coaster — developing a support network is key,” says Michelle Lewis, LCSW, of Salt Lake Weight Counseling. Having an opportunity to freely discuss concerns, expectations, and challenges with others who have been through the same experience can be invaluable. “Support groups provide the answers to many questions and can guide you in ways that surgeons do not address,” states Esther Wolkowitz, who lost 133 pounds after the procedure and has kept it off for over ten years. “The support groups provided me with information on managing plateaus and food alternatives for the different stages of recovery. These groups also offer key moral support and encouragement pre- and post-surgery.”

Alceen Ford-Meggett, who has maintained her 132-pound weight loss for eight years, encourages people to not go through the life-changing process alone. “In the beginning I felt like a failure because I couldn't lose the weight on my own. The support groups helped me with this. As with any support group you learn that you are not alone,” she says. Attending meetings helped Ford-Meggett identify her tendency towards emotional eating and change her habits. The groups also allowed her family to get involved and ask questions.

2. Assemble a health team. An important addition to every support system is a team of experts to guide you through the process, including a therapist specializing in emotional eating and a nutritionist, says Lewis. “Several studies have seen greater weight loss in patients who routinely follow up with a registered dietitian,” adds Kristen Smith, RD. “Bariatric surgery is only one tool in the toolbox for long-term success. Commitment to a permanent lifestyle change is a must and working alongside a team of experts can help a patient to commit to and maintain these changes.” Registered dietitians provide support and answer vital questions, while holding you accountable in preventing old eating habits from creeping back, she adds.

3. Rethink your relationship with food. For many patients who undergo bariatric surgery, the relationship with food is a complicated one. Rewiring yourself to think of food as fuel, instead of as an emotional comfort, is an essential part of the process. “Weight regain can occur if the relationship with food remains unchanged. If you struggled with emotional eating before surgery, the emotions are still there,” says Lewis. Paul Mason, formerly the world’s heaviest man, who lost 600 pounds through bariatric surgery and has kept it off since 2010, attributes his ongoing success to improving his emotional connection with food. “Work on creating a healthy relationship with food so that the emotional baggage that led to your weight gain initially is tempered or even squelched,” says Mason. With the help of your healthcare team, identify the emotional connections you have with food and work to change those patterns before and after surgery for the best chance at success.

4. Create new eating habits that will last a lifetime. As weight loss begins to slow, it can be easy to return to old habits and focus less on dietary guidelines. “Make sure to prioritize nutrient-dense foods,” says Lea Andes, RD, owner of BariAthletes. “Lean protein is important immediately after surgery, and continues to be, but don’t forget about fruits and vegetables, too.” In the years following surgery, as the stomach slowly expands and appetite begins to increase, incorporating low-calorie, high-volume foods like vegetables into your diet can be key to preventing weight regain.

5. Make fitness a priority, starting with the recovery process. “The body is made to move and the more it does, the better it works,” says Andes. Aim to be physically active most days of the week, and incorporate both cardiovascular and resistance exercises to preserve and build muscle mass, an essential component for a healthy metabolism, she says. After surgery, “walking is the foundation of exercise,” Andes advises. “Aim for small and attainable goals that you can build from.” She suggests increasing walking distance or time by 10 percent every week, or every 2 weeks if that feels too strenuous. “Once you feel like you have reached a good distance or time, you can start working on speed,” Andes adds.

Remember that slip ups are inevitable, but they don’t have to become major setbacks. “If you feel yourself slipping towards old eating habits, don't be afraid to seek help,” says Smith. By building a strong support system, improving your relationship with food, and creating new, healthy habits, bariatric surgery can be a valuable tool in promoting long-term weight-loss success