fixed detecting line number for syntax error in template