fix json generation for discard button