fix the issue with serializing data via JSON