Fix for duplicate matches in db

Now only adds matches if they are not already in the db.