fix bug to use custom template