improve checking of dependencies