Added recursive check for templates folder