Bug fix in payments.js