template parser made more block error safe