Added segfault fix at grroupchat event