added support for multiple template dirs