Mechanism of reaction between substituted aniline and potassium thiocyanate in presence of bromine and glacial acetic acid

Im currently doing this project where in we are synthesizing 2-amino-6-substituted benzothiazole by using p-substituted aniline with potassium thiocyanate in presence of bromine and glacial acetic acid.


My question is: how does the cyclization take place?


I know that the amino group of aniline is ortho and para directing so the phenyl thiocyanate is formed as the intermediate but then this intermediate reacts with bromine in presence of acetic acid to give 2-amino-6-substituted benzothiazole ... I do not get that step.


Please provide me with the mechanism as to how the cyclization takes place with those two reactants.


