adding chat function
change the IMcontroller class to singleton