updated component life cycle to handle cyclic dependencies