added check for name collision and test