changed template parse. added function.