fix inheritance chain issue
update to allow building an index and use precompiled template