fixed some json parsing bugs