added method to return number of lines of template
return number of last line of template if an error occurs that not all blocks got closed in a template