Until now you may have blamed it on that second (or third) beer. But new research suggests it may be due to something unrelated to your evening drinking habits: low testosterone levels.

A Taiwanese study of more than 500 middle-aged men published in the journal Urology found that men with the highest testosterone levels were 44 percent less likely to experience nocturia than those with the lowest.

“This is one of the earliest reports suggesting that testosterone levels could be linked with urinary symptoms,” says Men’s Health advisor Larry Lipshultz, M.D., a urologist at the Baylor College of Medicine in Houston. “One explanation may be that low testosterone levels contribute to low levels of nitric oxide.” A dip in nitric oxide could disrupt normal function of the bladder muscle and lead to urination issues such as nocturia, Lipshultz explains.

The research is preliminary, so hold off on demanding a prescription for low testosterone. Keeping testosterone levels within the normal range (a blood test can reveal your number—normal is 270 to 1,000 ng/dl of blood), however, will help ward off other issues associated with low testosterone, such as muscle loss, low bone density, decreased sex drive, and heart disease.

Research shows you can naturally boost testosterone levels with twice-weekly weight-lifting sessions, and by replacing unhealthy saturated fats in your diet (such as butter and red meat) with monounsaturated fats like olive oil and fish. And if those evening trips to the john are still disrupting your sleep, Lipshultz says a few other issues could be to blame:

Benign prostatic hypertrophy (BPH),
or enlarged prostate: This condition affects an estimated 19 million men. As the gland grows, it presses on the urethra and causes urination and bladder problems. Talk to your doctor.

Stress:
“This is a likely cause of nocturia in younger men,” Lipshultz says. “When anxious, your heart rate rises and increases urine production.” If stress is keeping you up, grab a pen and paper and write down your top problems and solutions. This will stop them from running through your mind all night.

Injury:
Whether from an accident or from riding a bike, scar tissue can build up and cause a stricture, hindering the flow of urine. If you experience an injury below the belt, get it checked out immediately, Lipshultz says.

Fluid intake:
OK, maybe those nightcaps are to blame. “Your body mobilizes fluids when you lie down,” Lipshultz says, “which makes you feel like you have to urinate.” Try limiting liquids an hour or two before bedtime.