add statements for caching device down its tree