fixed get_json function