loop onto directories