added loadfromjson method