fixed adding edges without dictionaries