code claenup and bug fized; added support  for different type os MT server