What was the dosage?
Generally, an adult dose is thought to be between 1 and 10 mg. Doses near the 30 mg mark are usually considered to be harmful. However, people's sensitivity to it can vary, making some more prone to side effects at lower doses than others. Taking too much melatonin for you can lead to unpleasant side effects. Perhaps, in your case you need to cut the dosage.