avoid read json file two times