changed from json to pickle