I wonder if an airlock would help?
https://www.amazon.com/Lactic-Acid-Vegetable-Sauerkraut-Fermenter/dp/B00IPQTVEW
These are pretty awesome. Little airlocks for mason jars.