Fixed a bug in the repo pin logic