Fixed output to give state as valid json