Occasional anxiety meds

Nina
I suffer from bad anxiety. When I found out I was pregnant I stop taking Xanax. 1mg. I'm on my 2nd trimester and I'm just wondering is it safe to take it occasionally???