correcting template inheritance