json output logic added