template now accept jQuery object