modified function to use user preferred repo first before default.