fix level calulation when a dependency is undefined