fix restrain_repo
fix TypeError