taking the dependencies into account as well

previously the code wasn't working properly as dictionary was randomly
accessing values that had a dependency to be activated first.