fixed the template bug in payment when there is no payer specified in a template