update directory template until if statement doesn't cause re-rendering of entire list