There may be a way to get the benefits of over-the-counter melatonin supplements without the risk.