aad init function