Added initial support for external DAG execution

added Null checks for taskScheduler