extending templates bug fixed