fixed template problems
fixed templates