copied stuff from Teachers pusher chat demo