solve json encoding issues