Fix dependency resolution issue due to task ordering