fixed issue where not correctly adding perm for existing repo