changed JSON handling