wrap dependencies in ensure_resource to avoid conflicts