template block closing fix