fixed prepareRepo