updated cuid and uid functionality. Change events to be triggered by name, cuid and uid