add raise exception for base class in template method