adding logic to convert to json