Charlie horses in my legs

I’m 36 weeks along today and I’ve been getting Charlie horses in my legs occasionally at night. I had a really painful one this morning! I already take a magnesium supplement which is supposed to help. Any other ideas on how to combat those??