changed to get json in constructor