Update CreateShardIfNotExists to check for shard first