refactored test a bit
fixed bug and added test for dependency success