add check for duplicate repo, and tests