fix payment processing code