After these changes, now when i edit the group of a member from "user maneger", for that user everything goes fine(no errors) and the change is done succesfully but all other members except this member is deleted. Chris--S adviced me to ask here. Thank you for your help.
note: i do not know my php version.
reopended, because it might be fixed only partially