fix js error set up purchase form