Having problems sleeping.

Tennessee
Is it safe to take melatonin? I'm 19 weeks pregnant and am having a horrible time getting to sleep.