fix template inheritance