implemented leave group function