added isExisting snippet