add template to dp