Created test function for the cicle dependencies case
If clause fixed