added assertions to path building