add template support
fix IP output
update example