refactoring some of the event handling code.
implemented setText function of collabString