added check on name existence