fixed check if name exists