fixed static mismatch problem in template