fix a bug in getting json