better dependency resolution (works after first run)