add company and msg file writing