templateOrdering bug fixed