Modified the chat controller to avoid jquery usage.