fix bug with directory template processing