Update the logic used to check whether an entry exists in db.