Fixed JSON handling issue