bug fix (Undefined variable: payment)