added basic error messages for unique names and handle leaving