fix issues with adding to existing repositories