Added a way to access parent template instance

Added a way to access parent template instance.