put directory in loop