changed to use json