check duplicate in DB