Refactor using timeout so that all child directives are resolved