Updated group chat code