fixed bug with selection of template directory