load dependencies with a loop