corrected dependency
added conditions