Updated isDuplicate so replaces '%s' with '?' in sqlite