added support for Template viewer selection