fix bugs in repo controller