added com initialization to AI class
adding msg initialization in AI
improving saftey of AI methods