avoiding json errors with simple but manual code